Learn R Programming

Genominator (version 1.26.0)

importToExpData: Import data to database

Description

This function imports data from a data frame to a table in a database.

Usage

importToExpData(df, dbFilename, tablename, overwrite = FALSE, verbose = getOption("verbose"), columns = NULL)

Arguments

df
A data frame containing data to be imported. Must have columns chr, location and strand.
dbFilename
The filename of the database to which the data will be imported.
tablename
Name of database table to write output data to.
overwrite
Logical indicating whether database table referred to in tablename argument should be overwritten.
verbose
Logical indicating whether details should be printed.
columns
Vector of column names of columns to be imported.

Value

Returns an object of class ExpData.

See Also

See Genominator vignette for more information. See also ExpData-class.

Examples

Run this code
N  <- 10000 # the number of observations. 
df <- data.frame(chr = sample(1:16, size = N, replace = TRUE),
                 location = sample(1:1000, size = N, replace = TRUE),
                 strand = sample(c(1L,-1L), size = N, replace = TRUE))
eDataRaw <- importToExpData(df, dbFilename = tempfile(),
                            tablename = "ex_tbl", overwrite = TRUE)

Run the code above in your browser using DataLab