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 think this would solve the problem:
df = data.frame(read.csv("data.csv")) # Split the dataset into 80-20 numberOfRows = nrow(df) bound = as.integer(numberOfRows *0.8) train=df[1:bound ,2] test1= df[(bound+1):numberOfRows ,2]