
Conversion of Eligible Columns to Factor Variables in a DataFrame
Source: R/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. This includes both NA and empty strings.
Arguments
- data
(
DataFrame)
inputS4Vectors::DataFrame.- omit_columns
(
characterorNULL)
which columns should be omitted from the possible conversion to factor and explicit missing level application.- na_level
(
string)
explicit missing level to be used for factor variables.