importToExpData: Import data to database

Description Usage Arguments Value Author(s) See Also Examples

View source: R/importAndManage.R

Description

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

Usage

1
2
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.

Author(s)

James Bullard bullard@berkeley.edu, Kasper Daniel Hansen khansen@jhsph.edu

See Also

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

Examples

1
2
3
4
5
6
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)

Genominator documentation built on Oct. 31, 2019, 8:56 a.m.