Description Usage Arguments Details Value References
Edited version of read.csv.sql
in the sqldf
package
(tcltk
functionality removed), used mainly to create a SQLite database
from a text file from within R.
1 2 3 |
file |
A file path or a URL (beginning with |
sql |
character string holding an SQL statement. The table representing
the file should be referred to as |
header |
as in |
sep |
as in |
row.names |
as in |
eol |
Character that ends lines |
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. |
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 |
drv |
ignored: the only drive used can be SQLite. |
... |
arguments passed to |
Reads the indicated file into an sql database creating the database if it does not already exist. Then it applies the sql statement returning the result as a data frame. If the database did not exist prior to this statement it is removed.
Note that it uses facilities of SQLite
to read the file which
are intended for speed and therefore not as flexible as in R. For
example, it does not recognize quoted fields as special but will
regard the quotes as part of the field. See the ‘sqldf’ help for
more information.
On Windows, if the filter
argument is used and if Rtools is
detected in the registry, then the Rtools bin directory is added to
the search path facilitating use of those tools without explicitly
setting any the path.
If the sql statement is a select statement then a data frame is returned.
http://cran.r-project.org/web/packages/sqldf/sqldf.pdf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.