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)
I can suggest using the rsample package:
# choosing 75% of the data to be the training data data_split <- initial_split(data, prop = .75) # extracting training data and test data as two seperate dataframes data_train <- training(data_split) data_test <- testing(data_split)