gnomeR icon indicating copy to clipboard operation
gnomeR copied to clipboard

Allow subset_by_frequency to calculate and subset by group frequency

Open karissawhiting opened this issue 1 year ago • 0 comments

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")

karissawhiting avatar May 16 '23 16:05 karissawhiting