powered by
Split data into training and test data frames
split_train_test(d, outcome, percent_train = 0.8, seed)
Data frame
Target column, unquoted. Split will be stratified across this variable
Proportion of rows in d to put into training. Default is 0.8
Optional, if provided the function will return the same split each time it is called
A list of two data frames with names train and test
This function wraps `caret::createDataPartition`.
# NOT RUN { split_train_test(mtcars, am, .9) # }
Run the code above in your browser using DataLab