I get the following error using geom_histogram() in ggplot2. Below it is reproduced with standard example data from R, but this seems to happen with any data I provide. I was unable to find explanations and I was unable to debug up through the origin of the error. Any guess? I am using RStudio Version 1.4.1106.
ggplot(diamonds, aes(x=carat)) + geom_histogram(bins=30)
Error in unit(unclass(x), attr(x, "unit"), attr(x, "data")) :
Invalid unit