We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9384f1d commit 077b268Copy full SHA for 077b268
R/layer.R
@@ -971,10 +971,13 @@ normalise_label <- function(label) {
971
return(NULL)
972
}
973
if (obj_is_list(label)) {
974
+ # Ensure that element in the list has length 1
975
label[lengths(label) == 0] <- ""
976
labels <- lapply(labels, `[`, i)
977
978
if (is.expression(label)) {
979
+ # Subclasses expressions, when converted to lists, retain their class.
980
+ # The unclass is needed to properly treat it as a vctrs-compatible list.
981
label <- unclass(as.list(label))
982
983
label
0 commit comments