-1

All i can do with sqldf package is calculate " avg" "count " and "sum". Can i define my own function for standard deviation?

It is really necessary for me to calculate Standard deviation using sqldf only.

Axeman
  • 32,068
  • 8
  • 81
  • 94
JAS
  • 25
  • 3
  • 6

1 Answers1

5

The function for standard deviation is stdev

d1 = data.frame(x=runif(10))
sqldf("select stdev(x) from d1")
Pekka
  • 2,348
  • 2
  • 21
  • 33
  • You just made me realize how stupid of me it was to ask this question at the first place. – JAS Feb 08 '16 at 13:38
  • 1
    Not stupid. I found my way here as well. The native R function for standard deviation is 'sd', Oracle SQL uses STDDEV, MS SQL does use STDEV, but it also has STDEVP. ASCII SQL uses STDDEV_POP....Judging by the sample, there are a number of reasonable names that could have been used for the standard deviation, after trying some, this is a good site to ask for help. – VictorZurkowski Mar 06 '17 at 16:38