Skip to content
Prev 349598 / 398498 Next

Randomly interleaving data frames while preserving order

Another option would be to stack your strata and then sample from the combined data frame, something like this:

sample_size <- 10
population <- rbind(df1,df2,df3)
sim.sample <- pop[sample(nrow(pop),sample_size, replace=FALSE),]

Hope this is helpful,

Dan

Daniel J. Nordlund, PhD
Research and Data Analysis Division
Services & Enterprise Support Administration
Washington State Department of Social and Health Services