Displaying 1 result from an estimated 1 matches for "randomsample1".
2009 Mar 19
2
Randomly splitting a data frame in half
I have a data frame in long format and I would like to randomly divide
this data frame in half. The data frame consists of 39622 rows and I
initially tried ...
randomsample1 <- data[sample(nrow(data),19811), ]
Where allows me to randomly select half of the rows and assign them to
randomsample1 but then I couldn't figure out how to select those rows
that were not selected and assign them to randomsample2.
Please cc me if you reply as I'm a digest subscrib...