I\'ve just started using R and I\'m not sure how to incorporate my dataset with the following sample code:
sample(x, size, replace = FALSE, prob = NULL)
scorecard package has a useful function for that, where you can specify the ratio and seed
scorecard
library(scorecard) dt_list <- split_df(mtcars, ratio = 0.75, seed = 66)
The test and train data are stored in a list and can be accessed by calling dt_list$train and dt_list$test
dt_list$train
dt_list$test