mardi 24 mars 2015

randomly selecting between two columns of data in a table in R

so I have a table which contains data on a subject taking two versions of a test. What I would like to do is write some code that allows me to randomly select which version of the test to include in the final table and which to discard. Here is some example data:



ID test1 test2

38762 21 36
37874 17 20
37813 15 17
37738 23 31
37470 25 36
37308 31 32
37039 25 16
36045 16 9


I need this to be as close to random as possible, so any help would be greatly appreciated.


Thanks in advance





Aucun commentaire:

Enregistrer un commentaire