An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121123/0e7d122b/attachment.pl>
read.csv.sql() to select from a large csv file
5 messages · Gabor Grothendieck, Anthony Damico, Rui Barradas +1 more
On Fri, Nov 23, 2012 at 11:12 AM, Juliane Struve
<juliane_struve at yahoo.co.uk> wrote:
Dear list,
Dear list,
I am using read.csv.sql() from the sqldf package to read
individual-based data from a csv file that is too large for R.
My original file contains a column called ?ID? that
identifies the individual. I would like to read in data for only
one individual at a
time, for example "Bobby".
read.csv.sql("filename",sql = 'select * from file where ID = ?Bobby?') works fine, but
Name <- "Bobby"
read.csv.sql("filename",sql = 'select * from file
where ID = Name') gives me an error message
?Error in sqliteExecStatement(con, statement,
bind.data) :
RS-DBI driver: (error in statement: no such column: Name)?
I would like to use a variable in the select statement because I have many individuals in the original csv file, is this possible ? I have no experience with sql, perhaps someone can kindly point out how to do this correctly or offer an alternative solution ?
See Example 5 on the sqldf home page: https://code.google.com/p/sqldf/#Example_5._Insert_Variables -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121123/cfbfcfaa/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121123/ac2bb931/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121123/87a9cf80/attachment.pl>