Usage
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", ...)
read.csv2.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 ""
sql
character string holding an SQL statement. The table representing the
file should be referred to as file.
eol
Character which ends line.
skip
Skip indicated number of lines in input file.
filter
If specified, this should be a shell/batch command that the input file is piped through. For read.csv2.sql it is by default the following on non-Windows systems: tr , .. This translates all commas in the file to dots. On Window
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.
drv
This argument is ignored.
Currently the only database SQLite supported by read.csv.sql and
read.csv2.sql is SQLite.
Note that the H2 database has a builtin SQL function,
CSVREAD, which can be used in place of