File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -506,7 +506,9 @@ simplify <- function(x) {
506
506
}
507
507
508
508
as_facets <- function (x ) {
509
- if (is_facets(x )) {
509
+ is_facets <- is.list(x ) && length(x ) > 0 &&
510
+ all(vapply(x , is_quosure , logical (1 )))
511
+ if (is_facets ) {
510
512
return (x )
511
513
}
512
514
@@ -535,17 +537,6 @@ f_as_facets <- function(f) {
535
537
as_quosures(vars , env , named = TRUE )
536
538
}
537
539
538
- is_facets <- function (x ) {
539
- if (! is.list(x )) {
540
- return (FALSE )
541
- }
542
- if (! length(x )) {
543
- return (FALSE )
544
- }
545
- all(vapply(x , is_quosure , logical (1 )))
546
- }
547
-
548
-
549
540
# When evaluating variables in a facet specification, we evaluate bare
550
541
# variables and expressions slightly differently. Bare variables should
551
542
# always succeed, even if the variable doesn't exist in the data frame:
You can’t perform that action at this time.
0 commit comments