Skip to content

Commit c0a6923

Browse files
authored
Consider PANEL for handling NAs in line geoms (#6541)
* consider panel as grouping structure * add news bullet
1 parent e78f4eb commit c0a6923

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

NEWS.md

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

3+
* Fixed bug where `NA` handling in `geom_path()` was ignoring panels (@teunbrand, #6533)
34
* Logical values for the linetype aesthetic will be interpreted numerically,
45
so that `linetype = FALSE` becomes 0/'blank' and `linetype = TRUE` becomes
56
1/'solid' (@teunbrand, #6641)

R/geom-path.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GeomPath <- ggproto("GeomPath", Geom,
1919
# middle since you expect those to be shown by a break in the line
2020
aesthetics <- c(self$required_aes, self$non_missing_aes)
2121
complete <- stats::complete.cases(data[names(data) %in% aesthetics])
22-
kept <- stats::ave(complete, data$group, FUN = keep_mid_true)
22+
kept <- stats::ave(complete, data$group, data$PANEL, FUN = keep_mid_true)
2323
data <- data[kept, ]
2424

2525
if (!all(kept) && !params$na.rm) {

0 commit comments

Comments
 (0)