A simple example of calculating standard dev:
d <- c(2,4,4,4,5,5,7,9) sd(d)
yields
[1] 2.13809
but
Looks like R is assuming (n-1) in the denominator, not n.