Answers for "Pass argument to group_by (2)"

0

Pass argument to group_by (2)

mytable <- function(x, group) {
  x %>% 
    group_by({{group}}) %>% 
    summarise(n = n())
}
mytable(iris, Species)
Posted by: Guest on October-23-2021

Browse Popular Code Answers by Language