df_cols_to_factor | R Documentation |
DataFrame
This 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.
df_cols_to_factor(data, omit_columns = NULL, na_level = "<Missing>")
data |
( |
omit_columns |
( |
na_level |
( |
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
.
dat <- colData(summarized_experiment)
any(vapply(dat, is.character, logical(1)))
any(vapply(dat, is.logical, logical(1)))
dat_converted <- df_cols_to_factor(dat)
any(vapply(dat_converted, function(x) is.character(x) || is.logical(x), logical(1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.