Currently subset_by_frequency() will subset and only return alteration columns in your gene binary with > x% prevalence. Sometimes it's useful to calculate these frequency/inclusion cutoffs by keeping genes or alterations that are x% prevalent within a certain variable group like 5% prevalence in male OR female group instead of 5% overall.
I think the best way to include this is with a by argument:
gene_binary %>%
subset_by_frequency(t = .1, by = "sex")
Currently
subset_by_frequency()
will subset and only return alteration columns in your gene binary with > x% prevalence. Sometimes it's useful to calculate these frequency/inclusion cutoffs by keeping genes or alterations that are x% prevalent within a certain variable group like 5% prevalence in male OR female group instead of 5% overall.I think the best way to include this is with a
by
argument: