-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
- Allow user to suppress messages like "
geom_line()
: Each group consists of only one observation. Do you need to adjust the group aesthetic?"
While you can (sometimes) eliminate this message if you use groups=1
or convert variables from factor to numeric, in one case you can not; when geom_line
is used in a facet plot and one of the facets has only one data point. This makes rmd's a little ugly
# remove all but one row where cyl == 6 (mtcars)
ind <- which(mtcars$cyl == 6)
exclude <- head(ind,-1)
mtcars2 <- mtcars |>
dplyr::slice(-exclude)
ggplot2::ggplot(mtcars2,ggplot2::aes(x=mpg,y=wt)) +
ggplot2::geom_point() +
ggplot2::geom_line() +
ggplot2::facet_wrap(~cyl)
#> `geom_line()`: Each group consists of only one observation.
#> ℹ Do you need to adjust the group aesthetic?
Created on 2024-07-24 with reprex v2.1.0
Metadata
Metadata
Assignees
Labels
No labels