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.
msplit(df, size = 0.7, seed = NA, print = T)
Dataframe to split
Split rate
Seed for random split
Print summary results
A list with both datasets, summary, and split rate