I have a doubt about how to sample a dataframe. The dataset is like this:

with 114 rows with 9 columns. I need to extract 3 subsets, each one of 38 rows (114 / 3).
I have this script, but it doesn't works for the last subset:
install.packages("Rcmdr") library(Rcmdr) ana <- read.delim("~/Desktop/ana", header=TRUE, dec=",") set1 <- ana[sample(nrow(ana), 38), ] set1.index <- as.numeric(rownames(set1)) ana2 <- ana[(-set1.index),] set2 <- ana2[sample(nrow(ana2), 38), ] set2.index <- as.numeric(rownames(set2)) ana3 <- ana2[(-set2.index),] ana3 For set1 and set2 I get the subsets correctly, but for set3 I get 50 rows (or less).
(Thank you in advance! =) )
dput.set_number <- sample(1:3, nrow(iris), replace = TRUE); set1 <- iris[set_number == 1, ]; set2 <- iris[set_number == 2, ]; set3 <- iris[set_number == 3, ]ormy_sets <- split(iris, set_number)