R - caret createDataPartition returns more samples than expected
问题 I'm trying to split the iris dataset into a training set and a test set. I used createDataPartition() like this: library(caret) createDataPartition(iris$Species, p=0.1) # [1] 12 22 26 41 42 57 63 79 89 93 114 117 134 137 142 createDataPartition(iris$Sepal.Length, p=0.1) # [1] 1 27 44 46 54 68 72 77 83 84 93 99 104 109 117 132 134 I understand the first query. I have a vector of 0.1*150 elements (150 is the number of samples in the dataset). However, I should have the same vector on the second