?paste
See also,
http://rwiki.sciviews.org/doku.php?id=large_scale_data:lsdioi_sqchunk for
additional examples.
Assuming stations[1:2] are tables your database:
simpleQuery<- paste("SELECT * FROM", stations[1]) # should read the whole
table when invoked
dbGetQuery(con_stations, simpleQuery)
Is this sort of what you had in mind?
Sincerely,
KeithC.
-----Original Message-----
From: Jonathan Greenberg [mailto:[email protected]]
Sent: Monday, May 10, 2010 4:21 PM
To: r-help
Subject: [R] dbSendQuery with R variables
Rhelpers:
I'd like to modify this RSQLite statement:
rs_stations<-dbSendQuery(con_stations, "select * from stations")
so that stations is actually an R variable, e.g.:
stations=c("stationA","stationB")
How would I modify the above statement to query from stations[[1]] (aka
"stationA")?
--j
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.