From 3863d3a311607ee9391d3e0d3686dd8616695ebb Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 8 Apr 2024 09:59:29 +0200 Subject: [PATCH 1/2] apply remove_missing() --- R/geom-curve.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/R/geom-curve.R b/R/geom-curve.R index a2597a8d72..586cd43457 100644 --- a/R/geom-curve.R +++ b/R/geom-curve.R @@ -47,6 +47,11 @@ GeomCurve <- ggproto("GeomCurve", GeomSegment, if (!coord$is_linear()) { cli::cli_warn("{.fn geom_curve} is not implemented for non-linear coordinates") } + data <- remove_missing( + data, na.rm = na.rm, + c("x", "y", "xend", "yend", "linetype", "linewidth"), + name = "geom_curve" + ) trans <- coord$transform(data, panel_params) From c550d09e6e07118d52784172b7bf5f7ba6475710 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Mon, 8 Apr 2024 10:00:26 +0200 Subject: [PATCH 2/2] add news bullet --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 5d24677959..18e3a7c57d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ # ggplot2 (development version) +* `geom_curve()` now appropriately removes missing data instead of throwing + errors (@teunbrand, #5831). * When facets coerce the faceting variables to factors, the 'ordered' class is dropped (@teunbrand, #5666). * `update_geom_defaults()` and `update_stat_defaults()` have a reset mechanism