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)
Just a more brief and simple way using awesome dplyr library:
library(dplyr) set.seed(275) #to get repeatable data data.train <- sample_frac(Default, 0.7) train_index <- as.numeric(rownames(data.train)) data.test <- Default[-train_index, ]