hadley/ggplot2 — Issue #376: error when using alpha-transparency when plotting a variable named "alpha"
Author: tdhock
Created: 2012-01-30 10:00:28+00:00
State: open

this is with the 0.9.0 development version of ggplot2

> library(ggplot2)
> ## error, but I expected to draw 1 point with 25% transparency...
> ## there seems to be a problem with the variable named "alpha"
> ggplot(data.frame(x=1,alpha=2),aes(x,alpha))+geom_point(alpha=1/4)
Error in UseMethod("scale_dimension") :
no applicable method for 'scale_dimension' applied to an object of class "NULL"
> ## ok when the variable name is not "alpha"
> ggplot(data.frame(x=1,y=2),aes(x,y))+geom_point(alpha=1/4)
> ## ok when you dont use transparency with a variable called "alpha"
> ggplot(data.frame(x=1,alpha=2),aes(x,alpha))+geom_point()