Learn R Programming

mikropml (version 1.6.1)

get_caret_dummyvars_df: Get dummyvars dataframe (i.e. design matrix)

Description

Get dummyvars dataframe (i.e. design matrix)

Usage

get_caret_dummyvars_df(features, full_rank = FALSE, progbar = NULL)

Value

design matrix

Arguments

features

dataframe of features for machine learning

full_rank

whether matrix should be full rank or not (see `caret::dummyVars)

progbar

optional progress bar (default: NULL)

Author

Zena Lapp, zenalapp@umich.edu

Examples

Run this code
if (FALSE) {
df <- data.frame(
  outcome = c("normal", "normal", "cancer"),
  var1 = 1:3,
  var2 = c("a", "b", "c"),
  var3 = c("no", "yes", "no"),
  var4 = c(0, 1, 0)
)
get_caret_dummyvars_df(df, TRUE)
}

Run the code above in your browser using DataLab