I have the following code which works with mutate_:
t1 <- data.frame(a=1:5,b=2:6,c=3:7)
my.eq <- "a + 2*b + c^2"
t1 %>%
mutate_(new_col=glue::glue("{my.eq}"))
Output:
a b c new_col
1 1 2 3 14
2 2 3 4 24
3 3 4 5 36
4 4 5 6 50
5 5 6 7 66
However, with mutate, it dosen't work:
a b c new_col
1 1 2 3 a + 2*b + c^2
2 2 3 4 a + 2*b + c^2
3 3 4 5 a + 2*b + c^2
4 4 5 6 a + 2*b + c^2
5 5 6 7 a + 2*b + c^2
Now that mutate_ is deprecated, how can I get the same functionality?
Thanks
Menachem