Suppose we take the sample data set in this we have Purchased column as dependent factor. So if we need to perform sample.split(), it it necessary to perform sample.split on Purchased column itself??
library(caTools)
split = sample.split(dataset$Purchased, SplitRatio = 0.8)
or we can do any other column like
split = sample.split(dataset$Age, SplitRatio = 0.8)
or on the entire data set as a whole ?
split = sample.split(dataset, SplitRatio = 0.8)