-project.org]
Namens Bryan Hanson
Verzonden: vrijdag 2 oktober 2009 17:21
Aan: R Help
Onderwerp: [R] ggplot2: proper use of facet_grid inside a function
Hello Again R Folk:
I have found items about this in the archives, but I'm still not getting
it right. I want to use ggplot2 with facet_grid
: [R] ggplot2: proper use of facet_grid inside a function
Hello Again R Folk:
I have found items about this in the archives, but I'm still not getting
it right. I want to use ggplot2 with facet_grid inside a function with
user specified variables, for instance:
p - ggplot(data
: [R] ggplot2: proper use of facet_grid inside a function
Hello Again R Folk:
I have found items about this in the archives, but I'm still not getting
it right. I want to use ggplot2 with facet_grid inside a function with
user specified variables, for instance:
p - ggplot(data
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
Now why do I always come up with a twisted bquote() where a simple
paste() would do!
Thanks,
baptiste
2009/10/5 hadley wickham h.wick...@gmail.com:
Whether or not what follows is to be recommended I don't know, but it
seems to work,
p - ggplot(diamonds, aes(carat, ..density..)) +
Hello Again R Folk:
I have found items about this in the archives, but I’m still not getting
it right. I want to use ggplot2 with facet_grid inside a function with
user specified variables, for instance:
p - ggplot(data, aes_string(x = fac1, y = res)) + facet_grid(. ~
fac2)
Where data,
6 matches
Mail list logo