mardi 14 juillet 2020

How to set seed for random sample selection?

Based on a data frame with grouped samples I'd like to pick 5 samples randomly from each group. I can do so easily using the function stratified from package splitstackshape. But is it possible to set a seed as to make the selection reproducible?

data(iris)
library(splitstackshape)
stratified(iris, "Species", 5)



Aucun commentaire:

Enregistrer un commentaire