I am trying to write a function and pass in 2 parameters. I am getting an error and the function is not able recognize the 2nd parameter.
library(dplyr)
Test2 <- function(df, kk) {
xx1 <- group_by_at(mtcars, vars(mpg, cyl, kk)) %>%
summarise(FreqOG = length(cyl))
xx1 <- data.frame(xx1)
}
yy1 <- Test2(mtcars,hp)