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

Prevent RColorBrewer::brewer.pal warning #1999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

s-fleck
Copy link

@s-fleck s-fleck commented Sep 14, 2021

RColorBrewer::brewer.pal() throws an (in this case) unnecessary warning if the output plot requires less than 2 colors. This is an easy fix, and does not change the workings of the code since RColorBrewer::brewer.pal() never returns less than three levels anywas:

> RColorBrewer::brewer.pal(2, "Set2")
[1] "#66C2A5" "#FC8D62" "#8DA0CB"
Warning message:
In RColorBrewer::brewer.pal(2, "Set2") :
  minimal value for n is 3, returning requested palette with 3 different levels

`RColorBrewer::brewer.pal()` throws an (in this case) unnecessary warning if the output plot requires less than 2 colors. This is an easy fix, and does not change the workings of the code since `RColorBrewer::brewer.pal()` never returns less than three levels anywas:

```
> RColorBrewer::brewer.pal(2, "Set2")
[1] "#66C2A5" "#FC8D62" "#8DA0CB"
Warning message:
In RColorBrewer::brewer.pal(2, "Set2") :
  minimal value for n is 3, returning requested palette with 3 different levels
```
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 this pull request may close these issues.

None yet

1 participant