This commit is contained in:
Tanushree Tunstall 2022-08-05 18:13:44 +01:00
parent 33925dafe9
commit d5bc1c272e
4 changed files with 193 additions and 12 deletions

View file

@ -28,7 +28,8 @@ lf_bp <- function(lf_df = lf_duet
, stat_grp_comp = c("R", "S")
, stat_method = "wilcox.test"
, my_paired = FALSE
, stat_label = c("p.format", "p.signif") ){
, stat_label = c("p.format", "p.signif")
) {
fwv = as.formula(paste0("~", facet_var))
#fwv = reformulate(facet_var)
@ -57,13 +58,22 @@ lf_bp <- function(lf_df = lf_duet
, outlier.colour = NA
#, position = position_dodge(width = 0.9)
, width = bp_width) +
geom_quasirandom(priority = "density"
geom_quasirandom(#priority = "density"
#, shape = 21
, size = dot_size
size = dot_size
, alpha = dot_transparency
, show.legend = FALSE
, cex = 0.8
, aes(colour = factor(eval(parse(text = colour_categ))) ))
, aes(
colour = factor(
eval(
parse(
text = colour_categ
)
)
)
)
) + ggplot2::scale_color_manual(values = consurf_bp_colours)
} else {
#Legend=factor(eval(parse(text = colour_categ)))
@ -71,16 +81,26 @@ lf_bp <- function(lf_df = lf_duet
p2 = p1 +
#theme(legend.title=element_text('XXX')) + # Legend doesn't need a title)
geom_quasirandom(priority = "density"
geom_quasirandom(#priority = "density"
#, shape = 21
, size = dot_size
size = dot_size
, alpha = dot_transparency
, show.legend = FALSE
# , fast = FALSE
, cex = 0.8
, aes(colour = factor(eval(parse(text = colour_categ))) )
, aes(
colour = factor(
eval(
parse(
text = colour_categ
)
)
)
)
#, aes(colour = Legend)
)
) +
ggplot2::scale_color_manual(values = consurf_bp_colours)
}
@ -115,6 +135,7 @@ lf_bp <- function(lf_df = lf_duet
, method = stat_method
, paired = my_paired
, label = stat_label[2])
return(OutPlot)
}