> s<-paste('avg(v',seq(from=2,to=length(test)-1),")",sep = "") > s1<-paste(s,sep="",collapse = ",") > s2<-paste("select v1,",s1,"from test group by v1",sep = " ") > sqldf(s2)->newdf > View(newdf)
> s<-paste('avg(v',seq(from=2,to=length(test)-1),")",sep = "") > s1<-paste(s,sep="",collapse = ",") > s2<-paste("select v1,",s1,"from test group by v1",sep = " ") > sqldf(s2)->newdf > View(newdf)