Working on a project for an introductory R course we've been asked to partition our data into Training, validation, and testing groups based on example code in our textbook. The code we've been given to work off of is:
mower.df <- read.csv("RidingMowers.csv")
set.seed(111)
train.index <- sample(row.names(mower.df), 0.6*dim(mower.df)[1])
valid.index <- setdiff(row.names(mower.df), train.index)
train.df <- mower.df[train.index, ]
valid.df <- mower.df[valid.index, ]
I'm not sure how I adapt this code to split the data into three groups however.