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.
is_facets()
1 parent abc62dd commit 4a3ffffCopy full SHA for 4a3ffff
R/facet-.R
@@ -506,7 +506,9 @@ simplify <- function(x) {
506
}
507
508
as_facets <- function(x) {
509
- if (is_facets(x)) {
+ is_facets <- is.list(x) && length(x) > 0 &&
510
+ all(vapply(x, is_quosure, logical(1)))
511
+ if (is_facets) {
512
return(x)
513
514
@@ -535,17 +537,6 @@ f_as_facets <- function(f) {
535
537
as_quosures(vars, env, named = TRUE)
536
538
539
-is_facets <- function(x) {
- if (!is.list(x)) {
540
- return(FALSE)
541
- }
542
- if (!length(x)) {
543
544
545
- all(vapply(x, is_quosure, logical(1)))
546
-}
547
-
548
549
# When evaluating variables in a facet specification, we evaluate bare
550
# variables and expressions slightly differently. Bare variables should
551
# always succeed, even if the variable doesn't exist in the data frame:
0 commit comments