Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion R/scale-.R
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,11 @@ ScaleDiscrete <- ggproto("ScaleDiscrete", Scale,
if (!is_null(pal_names)) {
# if pal is named, limit the pal by the names first,
# then limit the values by the pal
vec_slice(pal, is.na(match(pal_names, limits))) <- na_value
if (is.null(dim(pal))) {
pal[is.na(match(pal_names, limits))] <- na_value
} else {
vec_slice(pal, is.na(match(pal_names, limits))) <- na_value
}
pal <- vec_set_names(pal, NULL)
limits <- pal_names
}
Expand Down