search for: getavg

Displaying 1 result from an estimated 1 matches for "getavg".

Did you mean: getarg
2010 Aug 04
1
SQLDF from Variable Matrix
...y large dataset. This is part of commands I use routinely with several dataset so I would like to make it into function. The simplified examples are Test<-data.frame(A=c('a','b','c','a','b','c'),B=c(1,2,3,4,5,6)) #Create function (This one work) GetAvg<-function(Input,Bygroup){ AVG<-fn$sqldf("select A, avg(B) as Average, median(B) as Median from Test group by $Bygroup") return(AVG) } Result<-GetAvg(Test,'A') #Create function (This one does not work) GetAvg<-function(Input,Bygroup){ AVG<-fn$sqldf("sel...