I'm trying to plot dataframes that have 'non-variable-name' column
names (think spaces, ^2...) and was wondering if there's a way to pass
those to aes without having to rename the column and then fixing the
legend?
(Background: I'm working on a python wrapper, and while I could solve
this with another layer of indirection, I'd rather not).
Thank you,
so long,
Tyberius Prime
Try this,
d = data.frame(1:10, rnorm(10))
names(d) = c('with space #', '£$@')
ggplot(d) +
aes(`with space #`, `£$@`, colour = `£$@`) +
geom_point()
HTH,
baptiste
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2
>
that was exactly what I was looking for - but googling for 'R escape
variables' or 'R escape variable names' and variations failed me.
So long,
Tyberius Prime
On Jan 20, 1:32 pm, Tyberius Prime <tyberius_pr...@coonabibba.de>
wrote:
An other way to solve this would be to use rpy2:
http://rpy.sourceforge.net/rpy2/doc-2.1/html/graphics.html#package-ggplot2
L.