-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Make ScaleDiscrete$map()
compatible with vctrs-palettes
#6118
base: main
Are you sure you want to change the base?
Conversation
if (obj_is_list(pal) && !obj_is_list(na_value)) { | ||
# We prevent a casting error that occurs when mapping grid patterns | ||
na_value <- list(na_value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this, but I also don't know how else to solve this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is too bad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all the changes required for map()
to work or are some more cosmetic to make it fully based on vctrs?
Dealing with |
This PR aims to fix #6117.
Briefly,
ScaleDiscrete$map()
has been made vctrs-aware and now works with 2D structures too.A demonstration:
Created on 2024-09-20 with reprex v2.1.1