lf_bp2: add a "monochrome" option
This commit is contained in:
parent
d5bc1c272e
commit
57433607bc
1 changed files with 10 additions and 8 deletions
|
@ -37,15 +37,17 @@ lf_bp2 <- function(lf_df = lf_duet
|
||||||
#fwv = reformulate(facet_var)
|
#fwv = reformulate(facet_var)
|
||||||
|
|
||||||
# Only use the longer colour palette if there are many outcomes
|
# 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) {
|
if (length(levels(lf_df$outcome)) > 2) {
|
||||||
lf_bp_colours = consurf_bp_colours
|
lf_bp_colours = consurf_bp_colours
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lf_bp_colours =NULL
|
lf_bp_colours = hue_pal()(2)
|
||||||
#lf_bp_colours = hue_pal()(2)
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (bp_width == "auto"){
|
if (bp_width == "auto"){
|
||||||
bp_width = 0.5/length(unique(lf_df[[x_grp]]))
|
bp_width = 0.5/length(unique(lf_df[[x_grp]]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue