Skip to content

Not all items in the list aes() produces are quosures #2676

@rpruim

Description

@rpruim

https://github.com/tidyverse/ggplot2/blob/master/NEWS.md#ggplot2-2219000 claims

The primary developer facing change is that aes() is now a list of quosures (expression + environment pairs) rather than a list of symbols, and you'll need to take a different approach to extracting the information you need.

But not all elements are quosures:

aes(x = foo, y = 0) %>% str()
## List of 2
##  $ x: language ~foo
##   ..- attr(*, ".Environment")=<environment: R_GlobalEnv> 
##  $ y: num 0
##  - attr(*, "class")= chr "uneval"
aes(x = foo, y = 0) %>% lapply(class)
## $x
## [1] "quosure" "formula"
## 
## $y
## [1] "numeric"
## 
aes(x = foo, y = 0) %>% lapply(function(x) inherits(x, "quosure"))
## $x
## [1] TRUE
## 
## $y
## [1] FALSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions