If R does not recognize a categorical feature (input from user) as factor, converts to factor.

prepare_feats(dat, disp_feats, feat_types, clust_feats, trans_type)

Arguments

dat

Dataframe with samples from original dataset ordered according to the clustering within each leaf node.

disp_feats

Character vector specifying features to be displayed.

feat_types

Named vector indicating the type of each features, e.g., c(sex = 'factor', age = 'numeric'). If feature types are not supplied, infer from column type.

clust_feats

Logical. If TRUE, performs cluster on the features.

trans_type

Character string of 'normalize', 'scale' or 'none'. If 'scale', subtract the mean and divide by the standard deviation. If 'normalize', i.e., max-min normalize, subtract the min and divide by the max. If 'none', no transformation is applied. More information on what transformation to choose can be acquired here: https://cran.rstudio.com/package=heatmaply/vignettes/heatmaply.html#data-transformation-scaling-normalize-and-percentize

Value

A list of two dataframes (continuous and categorical) from the original dataset.