HI. I make this code:
getdata<-function('a','b','c' ,'d','e','f'){ drv <- dbDriver("SQLite") con<-dbConnect(drv, "sqlite.db") lt<-dbListTables(con) myf<-data.frame(NULL) for (i in 1:length(lt)) { myfile<-dbReadTable(con,lt[i]) myfile1<-myfile[-c(14:44)] myfile1$MODEL<-gsub(" ", "", myfile1$MODEL) library(RSQLite) library(sqldf) my_file<-sqldf("SELECT * FROM myfile1 where MODEL in ('a','b','c' ,'d','e','f')") my.file.spes<-conv(my_file) myf<-rbind(myf,my.file.spes) } wd<-myf[order(myf$Product, myf$Time),] wd1<-wd[!duplicated(wd),] wd2<-as.data.frame(as.matrix(wd1),stringsAsFactors = FALSE) wd3<-transform(wd2, Price = as.numeric(Price), Volume = as.numeric(Volume)) dbDisconnect(con) return(wd3) } I want this program also work when I use wd3<-getdata(a,b,c,d,e,f,g,h...) for any length of my selection. How should I do this then? Thanks- Tammy [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.