I was wondering if there might be a way to specify the name of a new variable used in mutate() (argument mutate_nm = "bb") inside the foo() function below?
library(tidyverse)
foo <- function(data = mtcars, mutate_nm, val = 12){
mutate(mutate_nm = val)
}
#==== EXAMPLE OF USE:
foo(mutate_nm = "bb") Doesn't produce a dataframe with a new column named `"bb"`