-
Notifications
You must be signed in to change notification settings - Fork 108
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
Label composer #465
Label composer #465
Conversation
R/label-compose.R
Outdated
orig <- x | ||
for (labeller in label_list) { | ||
x <- labeller(x) | ||
attr(x, "orig") <- orig |
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.
Attaching the original breaks as an attribute here so that 'aware' functions could use original numeric breaks if they've already been converted to character (when you need a number's sign or something)
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.
maybe something more specific than orig
? orig_label
is at least more descriptive
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 prefer orig_breaks
then because we attach breaks and not labels as attributes. This confusion just go to show how orig
was ambiguous 😅
Merge branch 'main' into compose_labels # Conflicts: # _pkgdown.yml
Thank you |
This PR aim to fix #462.
Briefly, it adds
compose_label()
that you can use to chain together function to format your labels. This saves one the hassle of writing an anonymous function to inject in-between steps.@davidhodge931 this is a way to solve #443 too :)
Created on 2024-10-08 with reprex v2.1.1