In the future, please include the packages you're using since createDataPartition
is not in base R. I'm assuming you're using the caret
package. If that is correct, did you find the times
argument?
trainIndex<- createDataPartition(lipids$RT..seconds., p=0.7, list=F, times=10)
As mentioned in the comment, you can just as simply use sample
:
sample(seq_along(lipids$RD..seconds), as.integer(0.7 * nrow(lipids)))
And sample
will choose a different random seed each time it is run, so you will get different orders.