tidyr: using mutate inside a function
问题 I'd like to use mutate function from the tidyverse to create a new column based on the old column using only a data frame and strings, which represent column headers, as inputs. I can get this to work without using the tidyverse (see function f below), but I'd like to get it to work using the tidyverse (see function f.tidy below) Can someone please post a solution for adding this column using mutate called from a inside function? df <- data.frame('test' = 1:3, 'tcy' = 4:6) # test tcy # 1 4 #