diff --git a/NEWS.md b/NEWS.md index fa734987ce..1b4dc36ba0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # ggplot2 (development version) +* Fixed spurious warning when `weight` aesthetic was used in `stat_smooth()` + (@teunbrand based on @clauswilke's suggestion, #5053). * The `lwd` alias now correctly replaced by `linewidth` instead of `size` (@teunbrand based on @clauswilke's suggestion #5051). diff --git a/R/stat-smooth.r b/R/stat-smooth.r index aad4dccf91..a6366f08ee 100644 --- a/R/stat-smooth.r +++ b/R/stat-smooth.r @@ -182,5 +182,7 @@ StatSmooth <- ggproto("StatSmooth", Stat, flip_data(prediction, flipped_aes) }, + dropped_aes = c("weight"), + required_aes = c("x", "y") )