You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the first plot, the second geom_point should not add anything, and so the plot should be equivalent to ggplot(mtcars, aes(x=mpg, y=wt))+geom_point()
The second plot works as expected
The third plot maybe should throw an error, but not that error. x is in empty, but there is no data to plot.
I don't believe it is a duplicate of #31 because the example there runs and gives a plot, just not as expected. The problem here is that an error is thrown when plotting saying that the variable can not be found. They may be related, of course.
Also, this may be a duplicate of #176, but I wasn't sure because there the xintercept part is outside an aes. However running that code gives a similar error (Error in eval(expr, envir, enclos) : object 'xintercept' not found) and I seem to recall that geom_vline makes a data.frame in the background. So this may be duplicate, or at least broadening, of #176.
Taking a quick look at the code, I think it is related to #31, but not I'm completely sure if it's the same or not. Somewhere the layer data is getting dropped completely, and only the plot data used - which does not contain x and y variables.
Summary
When an aesthetic is mapped to a variable in a data.frame which has that variable, but does not have any rows of data, an error is thrown.
Reproducible example
Results
Expected results
geom_point
should not add anything, and so the plot should be equivalent toggplot(mtcars, aes(x=mpg, y=wt))+geom_point()
x
is inempty
, but there is no data to plot.sessionInfo
This "0.9.0" is commit 16e69f6. It is also an error in 0.8.9, although sometimes with different (also non-informative) error messages.
The text was updated successfully, but these errors were encountered: