-
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
Allow to reverse the order of colours in a brewer palette #36
Conversation
Could you please merge/rebase and add a bullet to NEWS? |
8a9944c
to
316ca6a
Compare
Use the same argument name as hue_pal: direction
316ca6a
to
20161ad
Compare
Done, and squashed everything into one commit. |
I forgot to write the documentation before. Sorry. |
It passed! It'll be great if you can merge it before the release so that I can depend on it in ggplot2. |
if (direction == -1) | ||
pal <- rev(pal) | ||
|
||
return(pal) |
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.
For future reference, I prefer to use return()
only for early returns
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.
OK. I thought it was good practice to always have an explicit return()
(it's certainly less confusing for newcomers/students in my experience).
Allow to reverse the order of colours in a brewer palette
Thanks! |
BTW if you have a little more time, I'd love a PR with some tests :) |
What would you want me to test in this particular instance? The order of colors returned? The values of colors returned? |
Thanks for merging it anyway, I'll get to work on the ggplot end now! |
Use the same argument that hue_pal uses: direction