Hello,
Here is a way of doing what the question asks for. There might be
others, simpler, but this one works.
have %>%
summarise(across(
.cols = !contains("ptno"),
.fns = list(mean = mean, std = sd),
.names = "{col}_{fn}"
)) %>%
select(
-matches("^gender_.*_std$"),
-m
Hello All,
Would like to be able to summarize across in dplyr using variable names and a
condition. Below is an example "have" data set followed by an example "need"
data set. After that, I've got a vector of numeric variable names. After that,
I've got the very humble beginnings of a dplyr-bas
2 matches
Mail list logo