read.csv.sql: Main workhorse of makeDb

Description Usage Arguments Details Value References See Also

Description

Edited version of read.csv.sql in the sqldf package (tcltk functionality removed), used mainly to create a SQLite database from a text file. The function makeDb wraps this function in the tornado package, so no need to execute this directly.

Usage

1
2
3
read.csv.sql(file, sql = "select * from file", header = TRUE, sep = ",",
  row.names, eol, skip, filter, nrows, field.types, comment.char,
  dbname = tempfile(), drv = "SQLite", ...)

Arguments

file

A file path or a URL (beginning with http:// or ftp://). If the filter argument is used and no file is to be input to the filter then file can be omitted, NULL, NA or "". The textfile argument from makeDb is used here.

sql

character string holding an SQL statement. The table representing the file should be referred to as file.

header

as in read.csv

sep

as in read.csv

row.names

as in read.csv

eol

Character that ends lines

skip

Skip indicated number of lines in input file.

filter

see read.csv.sql in sqldf

nrows

Number of rows used to determine column types. It defaults to 50. Using -1 causes it to use all rows for determining column types. This argument is rarely needed.

field.types

A list whose names are the column names and whose contents are the SQLite types (not the R class names) of the columns. Specifying these types improves how fast it takes. Unless speed is very important this argument is not normally used.

comment.char

If specified this character and anything following it on any line of the input will be ignored.

dbname

As in sqldf except that the default is tempfile(). Specifying NULL will put the database in memory which may improve speed but will limit the size of the database by the available memory. When using tornado, tempfile() is not used: dbname must be provided as an argument to makeDb.

drv

ignored: the only drive used can be SQLite.

...

arguments passed to sqldf.

Details

This function is entirely wrapped by makeDb – experienced users may use this for debugging, but otherwise not usually necessary to call directly.

Value

If the sql statement is a select statement then a data frame is returned. In tornado, this is never the case.

References

http://cran.r-project.org/web/packages/sqldf/sqldf.pdf

See Also

makeDb


leekgroup/derfinder documentation built on May 20, 2019, 11:30 p.m.