Skip to content

Commit 1895864

Browse files
authored
Fix remove_missing() call in Stat$compute_layer() so that bidirectional layers work (#3555)
1 parent 94d18b8 commit 1895864

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

R/stat-.r

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,15 @@ Stat <- ggproto("Stat",
7676
snake_class(self)
7777
)
7878

79+
# Make sure required_aes consists of the used set of aesthetics in case of
80+
# "|" notation in self$required_aes
81+
required_aes <- intersect(
82+
names(data),
83+
unlist(strsplit(self$required_aes, "|", fixed = TRUE))
84+
)
85+
7986
data <- remove_missing(data, params$na.rm,
80-
c(self$required_aes, self$non_missing_aes),
87+
c(required_aes, self$non_missing_aes),
8188
snake_class(self),
8289
finite = TRUE
8390
)

0 commit comments

Comments
 (0)