How do I mutate a field when concatenating the name of the field?
library(tidyverse)
x <- "blah"
y <- "cyl"
mtcars %>%
mutate(paste0(x,y) := as.factor(cyl)) # "Error: The LHS of `:=` must be a string or a symbol"
mtcars %>%
mutate(paste0(x,y) = as.factor(cyl)) # Error: unexpected '=' in: "mtcars %>% mutate(paste0(x,y) ="
How ca I end up with a new field called 'blahcyl' that is a factor of cyl?