lineage: toggle for "all lineages"

This commit is contained in:
Tanushree Tunstall 2022-03-02 15:54:09 +00:00
parent 6c6709e41e
commit bf3194259e
2 changed files with 13 additions and 0 deletions

View file

@ -7,6 +7,8 @@
lin_count_bp <- function( lf_data = lin_lf
, x_categ = "sel_lineages"
, y_count = "p_count"
, all_lineages = F
, use_lineages = c("L1", "L2", "L3", "L4")
, bar_fill_categ = "count_categ"
, display_label_col = "p_count"
, bar_stat_stype = "identity"
@ -29,6 +31,11 @@ lin_count_bp <- function( lf_data = lin_lf
, y_label = c("Count", "SNP diversity")
#, y_label = c("Count")
) {
if(!all_lineages){
#lf_data = lf_data[lf_data$sel_lineages%in%use_lineages,]
lf_data = lf_data[lf_data[[x_categ]]%in%use_lineages,]
}
g = ggplot(lf_data
, aes( x = factor( eval(parse(text = x_categ)), ordered = T )
, y = eval(parse(text = y_count))