Learn R Programming

DECIPHER (version 2.0.2)

Add2DB: Add Data to a Database

Description

Adds a data.frame to a database table by its row.names.

Usage

Add2DB(myData, dbFile, tblName = "Seqs", clause = "", verbose = TRUE)

Arguments

myData
Data frame containing information to be added to the dbFile.
dbFile
A SQLite connection object or a character string specifying the path to the database file.
tblName
Character string specifying the table in which to add the data.
clause
An optional character string to append to the query as part of a ``where clause''.
verbose
Logical indicating whether to display each query as it is sent to the database.

Value

Returns TRUE if the data was added successfully, or FALSE otherwise.

Details

Data contained in myData will be added to the tblName by its respective row.names.

See Also

Seqs2DB, SearchDB, BrowseDB

Examples

Run this code
# Create a sequence database
gen <- system.file("extdata", "Bacteria_175seqs.gen", package="DECIPHER")
dbConn <- dbConnect(SQLite(), ":memory:")
Seqs2DB(gen, "GenBank", dbConn, "Bacteria")

# Identify the sequence lengths
l <- IdLengths(dbConn)

# Add lengths to the database
Add2DB(l, dbConn)

# View the added lengths
BrowseDB(dbConn)
dbDisconnect(dbConn)

Run the code above in your browser using DataLab