read.csv.sql() to select from a large csv file
On Fri, Nov 23, 2012 at 5:05 PM, Juliane Struve
<juliane_struve at yahoo.co.uk> wrote:
Rui, Anthony, and Gabor,
I got this to work in the end:
for(i in length(Names_EastCoast){
name <- Names_EastCoast[i]
sql <- paste("select * from file where ID =
'",name,"'",sep = "")
Data <- read.csv.sql("filename",sql = sql)
}
loops through all individuals in the csv file.
That sets i to the length of Names_EastCoast and then runs the query only once.
I think you want:
for(nam in Names_EastCoast) {
Data <- fn$read.csv.sql("filename",
sql = 'select * from file where ID = "$nam" ')
# ... process Data ...
}
Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com