lf_bp2: add a "monochrome" option

This commit is contained in:
Tanushree Tunstall 2022-08-05 18:28:10 +01:00
parent d5bc1c272e
commit 57433607bc

View file

@ -37,15 +37,17 @@ lf_bp2 <- function(lf_df = lf_duet
#fwv = reformulate(facet_var)
# Only use the longer colour palette if there are many outcomes
if (monochrome) {
lf_bp_colours = c(1:length(levels(lf_df$outcome)))
lf_bp_colours[c(1:length(levels(lf_df$outcome)))] = rgb(0,0,0)
} else {
if (length(levels(lf_df$outcome)) > 2) {
lf_bp_colours = consurf_bp_colours
}
else {
lf_bp_colours =NULL
#lf_bp_colours = hue_pal()(2)
lf_bp_colours = hue_pal()(2)
}
}
if (bp_width == "auto"){
bp_width = 0.5/length(unique(lf_df[[x_grp]]))