How do you make a function with piping that takes a variable name as an input? I am trying to make a more complicated version of the below function usable. Thanks!
test <- function(var){
iris %>%
group_by(Species) %>%
summarise(mean(var, na.rm=TRUE))
}