> Whether or not what follows is to be recommended I don't know, but it
> seems to work,
>
> p <- ggplot(diamonds, aes(carat, ..density..)) +
>  geom_histogram(binwidth = 0.2)
>
> x = quote(cut)
> facets = facet_grid(as.formula(bquote(.~.(x))))
> p + facets

That's what I'd recommend.  You can also just do

facets <- facet_grid(paste(". ~ ", var))

Hadley
-- 
http://had.co.nz/

______________________________________________
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