I am trying to take a data set and break it into 3 parts: training: 60%, testing: 20% and validation: 20%.
part1 <- createDataPartition(fullDataSet$classe, p=0.8, list=FALSE)
validation <- fullDataSet[-part1,]
workingSet <- fullDataSet[part1,]
When I do the same to break up again:
inTrain <- createDataPartition(workingSet$classe, p=.75, list=FALSE)
I get an error message:
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
Is there a way: a) to create 3 partitions of different sizes, or b) to make a nested partition, like what I was trying to do? I considered c) using sample () instead, but this is for a class in which the teacher uses only createDataPartition, and we need to show our code. Does anyone have any advice?
source
share