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 eb2caca commit db622adCopy full SHA for db622ad
R/subplots.R
@@ -339,14 +339,18 @@ dots2plots <- function(...) {
339
# helper function that warns if more than one plot-level attribute
340
# has been specified in a list of plots (and returning that attribute)
341
ensure_one <- function(plots, attr) {
342
- attrs <- lapply(plots, "[", attr)
+ attrs <- Filter(Negate(is.null), lapply(plots, "[[", attr))
343
+ if (length(attrs) == 0) {
344
+ warning("No ", attr, " found", call. = FALSE)
345
+ return (NULL)
346
+ }
347
for (i in seq_along(attrs)) {
348
if (!identical(attrs[[1]], attrs[[i]])) {
349
warning("Can only have one: ", attr, call. = FALSE)
350
break
351
}
352
- attrs[[length(attrs)]][[1]]
353
+ attrs[[length(attrs)]]
354
355
356
0 commit comments