lundi 24 août 2020

Get an uniform distributed sample but keep the order

How could i get a sample of a values of a vector but keep the order without compairing the values themself against each other?

for example:

V1 contains values (1,2,3,4,5,6,7,8,9,10,11,12,13,14)

I woule like to get a sample

sample <- (2,7,10,14)

As you can see the values are still on order but randomly selected.

But if i use a function sample or rdunif in R I get random orderd selection:

ie. (7,10,2,14)

Thank you!




Aucun commentaire:

Enregistrer un commentaire