DataPartition: Data Partition

View source: R/DataPartition.R

DataPartitionR Documentation

Data Partition

Description

Data Partition

Usage

DataPartition(data = NULL, outcome = NULL, proportion = 0.7, seed = 2022)

Arguments

data

A data.frame that contains the study’s features and the outcome variable.

outcome

A character string with the name of the outcome variable from the data.

proportion

A numeric value for the proportion of data to be put into model training. Default is set to 0.7.

seed

A numeric value for set.seed. It is set to be 2022 by default.

Value

This function returns a list with training and testing data sets using a stratified selection by the outcome variable as performed by the createDataPartition function from the caret package.

Examples

dp <- DataPartition(data = cp025q01.wgt, outcome = "outcome")

LOGANTree documentation built on June 23, 2022, 1:06 a.m.