DataFrameR/utils.R
df_cols_to_factor.RdThis utility function converts all eligible character and logical variables in a
S4Vectors::DataFrame to factor variables. All factor variables get amended
with an explicit missing level.
df_cols_to_factor(data, omit_columns = NULL, na_level = "<Missing>")(DataFrame)
input S4Vectors::DataFrame.
(character or NULL)
which columns should be omitted from
the possible conversion to factor and explicit missing level application.
(string)
explicit missing level to be used for factor variables.
The modified data.
All required rowData and colData variables cannot be converted
to ensure proper downstream behavior. These are automatically omitted if found in data
and therefore do not need to be specified in omit_columns.