Based on this post, I'm trying to make a sample of rows. Using the same R iris data example:
head(iris)
I've correctly create a sample of 15 rows for each species
Selec_ir<-iris[ with(iris, unlist(tapply(seq_len(nrow(iris)),
Species, FUN = sample, 15,replace=FALSE))), ]
But now how to create a sample based on the condition that the new selected row must be at least after 20 rows from the last selected one?
Aucun commentaire:
Enregistrer un commentaire