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.
rlang::flatten_if()
1 parent 1932002 commit 9503d74Copy full SHA for 9503d74
R/facet-.R
@@ -332,7 +332,14 @@ validate_facets <- function(x) {
332
333
# Flatten a list of quosures objects to a quosures object, and compact it
334
compact_facets <- function(x) {
335
- x <- flatten_if(x, is_list)
+
336
+ proxy <- vec_proxy(x)
337
+ is_list <- vapply(proxy, vec_is_list, logical(1))
338
+ proxy[is_list] <- lapply(proxy[is_list], unclass)
339
+ proxy[!is_list] <- lapply(proxy[!is_list], list)
340
+ new <- list_unchop(proxy, ptype = list(), name_spec = "{outer}_{inner}")
341
+ x <- vec_restore(new, x)
342
343
null_or_missing <- vapply(x, function(x) quo_is_null(x) || quo_is_missing(x), logical(1))
344
new_quosures(x[!null_or_missing])
345
}
0 commit comments