Hi!

> In this case you are better off moving away from qplot (which does
> various substitute tricks to assemble the named variables in a data
> frame) to a more explicit form of ggplot:
> 
> pl2[[obs]] <- ggplot(cData, aes_string(x="x3", y=obs)) + geom_point()
> + opts(title = obs)

Ok, I will try that, thanks. BTW, where is this aes_string option
documented, sounds useful? How could I do the same thing with facetting?
If I want to save something like ". ~ groupVar" as a string in a
variable, could I pass it with facet_string to ggplot?

But anyway, I would be curious how to do it with qplot. The basic
question is: How to pass the string of a variable to a function which is
supposed to interpret it. Aka:

var <- "magicVar"

fun(doSomeMagic(var))

doSomeMagic should then write magicVar at the place.

Greetings,

Sebastian Weber

> 
> Hadley
> 
>

______________________________________________
R-help@r-project.org mailing list
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