I'm using ggplot2 2.0.8 and R 2.8.0 df = data.frame(Year = rep(1:5,2)) m = ggplot(df, aes(Year=Year)) m + geom_bar() Error in get("calculate", env = ., inherits = TRUE)(., ...) : attempt to apply non-function