pak::pak("cran/ggplot2@3.4.0")
Error messages
ggplot2 3.4.0
ggplot2
ggplot2 3.4.0 has improved error messages when running plots.
Install ggplot2 3.4.0 with:
Load the package with:
Better error messages
…with better wording + cli package’s rich text formatting!
library(ggplot2)
ggplot(mtcars) |>
geom_point(aes(mpg, disp))
Error in `geom_point()`:
! `mapping` must be created by `aes()`
ℹ Did you use `%>%` or `|>` instead of `+`?
ggplot2 error messages can be hard to diagnose because you get the error when you print the plot rather than when it happens in the code. This version tells you what the problem is, where it came from, and what to do about it.