I am creating a summary data frame for multiple columns with dplyr, and it works well for desired functions excepts for count or n(). I want to show total number of observations.
summ <- Test_data %>%
summarize(across(
.cols = is.numeric,
.fns = list(a=n(),mean=mean, stdev=sd, max=max,min=min), na.rm=TRUE,
.names = "{col}_{fn}"
))
It gives error:
Error: Problem with summarise() input ..1.x Can't convert an integer vector to function
i Input ..1 is across(...).
Why just function for counts does not work, please advise.