-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updating default color palettes and adding custom_palette() #114
Conversation
…es ggsci color hex values
@tristan-myles just took a peek at the conflicts, I think the error message may need to also be updated for |
- Fixes conflicts in R/fig_utils, R/forest_plot, man/forest_plot
@@ -90,11 +90,11 @@ forest_plot <- function(df, facet_by = NA, shape_by = NA, col_by = NA, | |||
## use the palette if provided, otherwise use the default | |||
## as defined in epireview | |||
## if neither is provided, use the default palette | |||
if (!is.na(shp_palette)) { | |||
if (!is.null(shp_palette)) { | |||
p <- p + scale_shape_manual(values = shp_palette, na.value = 4) |
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.
@shaziaruybal Can you check that this na.value param is fine? I've added it based on the merge conflicts, but it wasn't in the initial version of develop that you were working on
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.
@tristan-myles and I have checked and we think the na.value param is fine
if (!is.na(col_palette)) { | ||
p <- p + scale_color_manual(values = col_palette, na.value = "gray") | ||
if (!is.null(col_palette)) { | ||
p <- p + scale_color_manual(values = col_palette, na.value = "gray") |
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.
@shaziaruybal Same as my previous comment, can you check that this na.value param is fine?
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.
@tristan-myles and I have checked and we think the na.value param is fine
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.
In addition to my two comments on the files changed:
-
devtools::check is failing because load-filter-view-epidata.Rmd no longer compiles due to the changes in forest_plot.R. Could you check the functions used in this vignette. I think you just need to provide custom palettes?
Additionally, to confirm, is this the expected behaviour when now custom palette is provided? -
I've bumped the version to 1.3.4 based on the anticipated merge of Sangeeta's PR, can you just add a brief description of the changes introduced in this PR in the NEWS.md file. A brief one-liner is fine. :)
- Fixes version conflict in DESCRIPTION
we fixed a minor bug when newest version of |
- NA set to NULL
- Default param updated to NULL
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.
Passes tests and RCMD check passes
Pull Request
This PR responds to #20 and updates the default color palette to a hopefully nicer one from
ggsci
. It also fixes a bug (see 8a2d5bb and 193f172).Additional changes:
custom_palette()
was created to hopefully aid users to build their own custom palettes, especially if they want to visualise parameters with "multi-country" labels (eg "Guinea, Liberia, Sierra Leone") since the default palette will only work for single-country labels eg ("Guinea").custom_palette()
have also been addedExample usage of
custom_palette()
:Checklist:
DESCRIPTION
DESCRIPTION
(I am now working off of an earlier version so didn't update any version numbers)NEWS.md
testthat
devtools::install_local("<path-to-epireview>")
priority-pathogens