Skip to contents

This function splits a data.frame into training and test sets.

Usage

ttsplit(df, prop_train = 0.7)

Arguments

df

data.frame

prop_train

proportion of rows to be allocated to training

Value

list with elements:

train

df with prop_train*100% rows sampled at random

test

df with remaining rows

Examples

tt <- df |> ttsplit()
#> [1] "Split df into list with: train, test (proportion train = 0.7)"