2

I'm trying to do this

library(ggplot2)

foo <- 4
ggplot(mtcars, aes(x = wt, y = ..count.. + foo)) + geom_histogram()

And I'm getting

Error in eval(expr, envir, enclos) : object 'foo' not found

Oddly, this works

ggplot(mtcars, aes(x = wt + foo)) + geom_histogram()

Why is it that I can add foo to wt in aes(), but not to ..count..?

moc
  • 81
  • 4
  • See [this](http://stackoverflow.com/questions/14570293/special-variables-in-ggplot-count-density-etc) thread – Miha Jul 14 '16 at 21:03

0 Answers0