View source: R/format_covariates.R
format_covariates | R Documentation |
Mainly, this method splits the categorical variables (which should be 'factor' variables)
into indicator variables (i.e.,
one-hot encoding), dropping the last level, and then rescales
all the numerical variables (but does not center them),
and computes the "Log_UMI"
(i.e., log total counts) for each cell.
"Log_UMI"
is added as its own column.
format_covariates(
dat,
covariate_df,
bool_center = FALSE,
rescale_numeric_variables = NULL,
variables_enumerate_all = NULL
)
dat |
Dataset (either |
covariate_df |
|
bool_center |
Boolean if the numerical variables should be centered around zero, default is |
rescale_numeric_variables |
A vector of strings denoting the column names in |
variables_enumerate_all |
If not |
a matrix
with the same number of rows as dat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.