Re: [R] Random Sampling from a Matrix

2007-08-22 Thread Uwe Ligges
Anup Nandialath wrote: > Dear Friends, > > I have a matrix of size 5000 X 20. The first two columns are indicator > variables taking the value of either 0 or 1. Let us call the first two > columns Y1 and Y2. > > I need to randomly sample 1000 rows with all the associated columns, in other >

[R] Random Sampling from a Matrix

2007-08-21 Thread Anup Nandialath
Dear Friends, I have a matrix of size 5000 X 20. The first two columns are indicator variables taking the value of either 0 or 1. Let us call the first two columns Y1 and Y2. I need to randomly sample 1000 rows with all the associated columns, in other words my new matrix should be of size 10