diff --git a/NEWS.md b/NEWS.md index 520dc1e6ee..3f8644df2b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # ggplot2 3.0.0.9000 +* The error message in `compute_aesthetics()` now provides the names of only + aesthetics with mismatched lengths, rather than all aesthetics (@karawoo, + #2853). + * `geom_sf()` now respects `lineend`, `linejoin`, and `linemitre` parameters for lines and polygons (@alistaire47, #2826) diff --git a/R/geom-.r b/R/geom-.r index 6ddb7a1499..c5050349cd 100644 --- a/R/geom-.r +++ b/R/geom-.r @@ -184,7 +184,7 @@ check_aesthetics <- function(x, n) { stop( "Aesthetics must be either length 1 or the same as the data (", n, "): ", - paste(names(!good), collapse = ", "), + paste(names(which(!good)), collapse = ", "), call. = FALSE ) }