library(dplyr)
df <- data_frame(base = 1:10)
for (i in 2:5) {
df <- df %>% mutate(paste0("power_",i) = base^i )
}
for (i in 2:5) {
df <- df %>% mutate_(paste0("base^",i) )
}
--
You received this message because you are subscribed to the Google Groups "manipulatr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to manipulatr+...@googlegroups.com.
To post to this group, send email to manip...@googlegroups.com.
Visit this group at https://groups.google.com/group/manipulatr.
For more options, visit https://groups.google.com/d/optout.