Skip to content
Prev 55396 / 398500 Next

How to draw an observation uniformly from a given dataset?

wanr at ucalgary.ca wrote:
Sample the indices, as in

idx <- sample(1:10, 1)
data[idx, ]