On 13/06/17 13:55, Donald Macnaughton wrote:

I have the string ggstr that I've built with string manipulation:

ggstr =  "ggplot(df1, aes(x,y)) + geom_smooth(se=FALSE, span=0.01)"

Assuming df1 is properly defined, this string will execute properly if I
submit it manually without the quotes. How can execute the command as a
string, so that I can run it repeatedly (with minor modifications) in a
loop?  Presumably, it would be something like:

execute(ggstr)

Thanks for your help.

eval(parse(text = ggstr))

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to