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)
We can divide data into a particular ratio here it is 80% train and 20% in a test dataset.
ind <- sample(2, nrow(dataName), replace = T, prob = c(0.8,0.2)) train <- dataName[ind==1, ] test <- dataName[ind==2, ]