Any #rstats people know why the sd(x) function in base R doesn't work but sapply(x, sd) does? Is everyone just piping things into the sd function these days? Is there a secret sd function club I'm not a member of? Seems kind of an important, basic stats operation to not work.
2
2
3
Provide a MCVE or it doesn't count :)
> sd(1:10)
[1] 3.02765
> set.seed(123); sd(rnorm(10))
[1] 0.953784
>
Is you 'x' a list or data.frame? Well yes in that case you need to loop over columns.
Sep 18, 2021 · 5:42 PM UTC
1

