Re: [R] Select Random Rows from a dataframe

2011-07-21 Thread Joshua Wiley
Hi Sean, Here is one option that I believe does what you want. The logic is simple, 1) instatiate a test value that does not meet your criteria 2) use a while loop that will keep looping until your criteria is met (be sure you set a meetable criteria or this will continue ad nauseum!!!), 3) rand

[R] Select Random Rows from a dataframe

2011-07-21 Thread Sean Bignami
Hi all, I have a dataframe of behavioral observations from 360 fish, each with 241 observation points(rows), which looks like this: > head(d) fishtreatment tank trial video tid pid ang.chgabs.ac t lenvel d2p x y 1 1