Error in calculating mean using sqldf package in R

sqldf
r

#1

Hello,

I am trying to calculate group means by using the sqldf package in R.However I am getting an error:

What has to be done here?I am aware of functions such as aggregate and apply which can do the same but I am interested in using this package so can somebody kindly point out where the error is


#2

In SQL, the function used to obtain the mean is avg short for average which is why you are getting an error that says no such function mean exists.
Using avg(Fresh) instead of mean(Fresh) should work.