Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle the case when a quosure is the default aes (from_theme()) #195

Closed
yutannihilation opened this issue May 11, 2024 · 0 comments · Fixed by #196
Closed

Handle the case when a quosure is the default aes (from_theme()) #195

yutannihilation opened this issue May 11, 2024 · 0 comments · Fixed by #196

Comments

@yutannihilation
Copy link
Owner

tidyverse/ggplot2#5833

Error message:

Error in `map2()`:
ℹ In index: 1.
Caused by error in `aes_param_name %in% names(non_null_default_aes) && is.na(non_null_default_aes[[aes_param_name]])`:
! 'length = 2' in coercion to 'logical(1)'
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In is.na(non_null_default_aes[[aes_param_name]]) :
  is.na() applied to non-(list or vector) of type 'language'

Code:

gghighlight/R/gghighlight.R

Lines 443 to 447 in f006c02

# if the geom has default value and is NA, use NA
if (aes_param_name %in% names(non_null_default_aes) &&
is.na(non_null_default_aes[[aes_param_name]])) {
return(NA)
}

Browse[1]> str(non_null_default_aes)
List of 6
 $ shape : language ~from_theme(pointshape)
  ..- attr(*, ".Environment")=<environment: namespace:ggplot2> 
 $ colour: language ~from_theme(ink)
  ..- attr(*, ".Environment")=<environment: namespace:ggplot2> 
 $ size  : language ~from_theme(pointsize)
  ..- attr(*, ".Environment")=<environment: namespace:ggplot2> 
 $ fill  : logi NA
 $ alpha : logi NA
 $ stroke: num 0.5
 - attr(*, "class")= chr "uneval"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant