Given this dataframe:
t1 <- data.frame(x=c(1,2,3), y = c(2,3,4))
I would like to get the output as in this function:
t1 %>% mutate_('y' = 'y * 2')
But in such a way that I can define the input somewhere else:
t2 <- 'y'
t3 <- 'y * 2'
t1 %>% mutate_(t2 = t3) # Should produce output as t1 %>% mutate_('y' = 'y * 2')
Thanks for your help!
Best, Jan