assembleData: Assemble train and test data for model building with EWStools

Description Usage Arguments Details Value Note

Description

Assemble train and test data for model building with EWStools

Usage

1
2
assembleData(data, class, p, predvars, classification = TRUE,
  keepNA = FALSE, ...)

Arguments

data

a dataframe that the user would like to split into training and sample sets

class

character value of the name of the dependent variable

p

the proportion of data to be placed into a training set

predvars

a character vector of the names of predictor variables

classification

Is the training set for a classification problem or not? Default is TRUE.

keepNA

Should missing values be preserved in the data sets? Logical. Default is FALSE.

...

additional arguments to be passed to assembleData

Details

To return a 3-way split with a validation set, use the pvalid argument.If classification is set to true the "class" component of the list will be forced to a factor for being fed into the train routine.

Value

A list of lists with the following items:

traindata

a list with a dataframe of the predictor matrix called preds, and the class called class

testdata

a list with a dataframe of the predictor matrix called preds, and the class called class

Note

Built on the createDataPartition function in the caret package.


jknowles/EWStools documentation built on May 19, 2019, 11:42 a.m.