I'd like to use my own function smd
in summarize_at
, without success. If I try to do:
library(dplyr)
# My function
smd<-function(x,...)
{sd(x)/sqrt(length(x)-1)}
starwars %>%
summarise_at(c("height", "mass"), smd, na.rm = TRUE)
Erro: C stack usage 15924224 is too close to the limit
Doesn't work!! Try to make funs(smd)
and funs(sd/sqrt(n()-1))
and dosen't work too!
Please, any ideas?