Skip to content

Commit 09bcda6

Browse files
authored
geom_curve() removes missing data (#5832)
* apply remove_missing() * add news bullet
1 parent a420264 commit 09bcda6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ggplot2 (development version)
22

3+
* `geom_curve()` now appropriately removes missing data instead of throwing
4+
errors (@teunbrand, #5831).
35
* `update_geom_defaults()` and `update_stat_defaults()` have a reset mechanism
46
when using `new = NULL` and invisible return the previous defaults (#4993).
57
* Fixed regression in axes where `breaks = NULL` caused the axes to disappear

R/geom-curve.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ GeomCurve <- ggproto("GeomCurve", GeomSegment,
4747
if (!coord$is_linear()) {
4848
cli::cli_warn("{.fn geom_curve} is not implemented for non-linear coordinates")
4949
}
50+
data <- remove_missing(
51+
data, na.rm = na.rm,
52+
c("x", "y", "xend", "yend", "linetype", "linewidth"),
53+
name = "geom_curve"
54+
)
5055

5156
trans <- coord$transform(data, panel_params)
5257

0 commit comments

Comments
 (0)