Skip to content

Commit ec193c0

Browse files
committed
stop complaints about 0-length labels, which is commonly used in label supression
1 parent 6743479 commit ec193c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/labels.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ setup_plot_labels <- function(plot, layers, data) {
7878
# `geom_function()`. We can display these labels anyway, so we include them.
7979
plot_labels <- plot@labels
8080
known_labels <- c(names(labels), fn_fmls_names(labs), "x", "y")
81-
extra_labels <- setdiff(names(plot_labels), known_labels)
81+
extra_labels <- names(plot_labels)[lengths(plot_labels) > 0]
82+
extra_labels <- setdiff(extra_labels, known_labels)
8283

8384
if (length(extra_labels) > 0) {
8485

0 commit comments

Comments
 (0)