Mutate multiple variable to create multiple new variables
问题 Let\'s say I have a tibble where I need to take multiple variables and mutate them into new multiple new variables. As an example, here is a simple tibble: tb <- tribble( ~x, ~y1, ~y2, ~y3, ~z, 1,2,4,6,2, 2,1,2,3,3, 3,6,4,2,1 ) I want to subtract variable z from every variable with a name starting with \"y\", and mutate the results as new variables of tb. Also, suppose I don\'t know how many \"y\" variables I have. I want the solution to fit nicely within tidyverse / dplyr workflow. In