Learn R Programming

lares (version 4.4)

msplit: Split a dataframe for training and testing sets

Description

This function splits automatically a dataframe into train and test datasets. You can define a seed to get the same results every time, but has a default value. You can prevent it from printing the split counter result.

Usage

msplit(df, size = 0.7, seed = NA, print = T)

Arguments

df

Dataframe to split

size

Split rate

seed

Seed for random split

print

Print summary results

Value

A list with both datasets, summary, and split rate