R: eval & parse function

R:eval & parse function
library(ggplot2)

x=c("vs","cyl","carb","gear")

for (i in x){print(ggplot(aes(x=disp,y=mpg),data=mtcars)+geom_point()+facet_grid(~eval(parse(text=i))))}

這個網誌中的熱門文章

Python: character sort