filter_rare_table_cols {POMS} | R Documentation |
Filters out columns of dataframe based on number of proportion of non-zero cells
Description
Filters dataframe columns with either a low absolute count of non-zero values or a low proportion of rows with non-zero counts. Note that this function is intended for positively-bounded data only (e.g., the function or taxon abundance tables), and will not work properly if the table contains negative values. Included in package simply to make running workflow easier.
Usage
filter_rare_table_cols(
in_tab,
min_nonzero_count,
min_nonzero_prop,
drop_missing_rows = TRUE,
verbose = TRUE
)
Arguments
in_tab |
input dataframe |
min_nonzero_count |
minimum number of cells in column that must be non-zero for column to be retained. |
min_nonzero_prop |
minimum proportion of cells in column that must be non-zero for column to be retained. |
drop_missing_rows |
boolean flag to indicate whether rows with all zero values (after dropping columns based on specified cut-offs) should be removed. |
verbose |
boolean flag to indicate that the number of columns removed should be written to the console. |
Value
dataframe with columns that did not meet the min_nonzero_count
and/or min_nonzero_prop
options removed (and potentially rows dropped too if drop_missing_rows=TRUE).