You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm missing something entirely, but when I specify function(x) in acr()'s function list (say, if I wanted to specify additional arguments to each function), it doesn't quite work...
library(collapse)
#> Warning: package 'collapse' was built under R version 4.1.2#> collapse 1.7.6, see ?`collapse-package` or ?`collapse-documentation`#> #> Attaching package: 'collapse'#> The following object is masked from 'package:stats':#> #> Dmtcars|>
fsummarise(
acr(
mpg, list(
ssdd=sd,
mu=mean
)
)
)
#> mpg_ssdd mpg_mu#> 1 6.026948 20.09062mtcars|>
fsummarise(
acr(
mpg, list(
ssdd=function(x) sd(x),
mu=function(x) mean(x)
)
)
)
#> mpg_ssdd mpg_mu#> 1 6.026948 6.026948
Thanks, this is interesting, it seems to have to do with you using x in both cases. Using x for the first and yfor the second works. I'll keep this issue open until it is solved.
SebKrantz
changed the title
Peculiar behavior when using function(x) ... in acr()
Differentiate between multiple function(x) calls in across()
Feb 17, 2022
Maybe I'm missing something entirely, but when I specify function(x) in acr()'s function list (say, if I wanted to specify additional arguments to each function), it doesn't quite work...
Created on 2022-02-17 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: