hadley/ggplot2 — Issue #396: errors caused by certain variable names
Author: DavidLovell
Created: 2012-02-09 03:51:51+00:00
State: open

Apologies if I've missed mention of this elsewhere, but it looks as though certain variable names can cause.
In the following code...

```R
require(ggplot2)

eg <- data.frame(x=sort(rnorm(20)),
y=sort(rnorm(20)),
group=rep(c("A","B"), len=20),
GROUP=rep(c("A","B"), len=20))

ggplot(eg, aes(x=x, y=y)) + geom_point() + facet_wrap(~ group)
ggplot(eg, aes(x=x, y=y)) + geom_point() + facet_wrap(~ GROUP)
```

...the first ggplot call produces the error:

```R
Error in names(out) <- names(x) :
'names' attribute [2] must be the same length as the vector [0]
```

while the second works a treat.