[R] how to track a number in a row

2010-01-11 Thread Márcio Resende
Hi, I have a 100x15 matrix and in each row a set of 15 random numbers out of 25. for example: b - c(1:25) a -matrix(0,10,15) for (i in 1:10){ a[i,] - sample(b,15,replace = FALSE) } I would like to create another matrix (25x100), for example d with the probability of each number from the first

Re: [R] how to track a number in a row

2010-01-11 Thread Márcio Resende
Therefore I need to track, for example, if number 1 is present in the first row (d[1,1]) (which would give me an probability of 1 out of 1). Just to make it clear, I need to track on matrix a if number 1 is present in the first row to fill the spot d[1,1] where the first collumn is related to

Re: [R] how to track a number in a row

2010-01-11 Thread David Winsemius
On Jan 11, 2010, at 9:38 PM, Márcio Resende wrote: Hi, I have a 100x15 matrix and in each row a set of 15 random numbers out of 25. for example: b - c(1:25) a -matrix(0,10,15) for (i in 1:10){ a[i,] - sample(b,15,replace = FALSE) } I would like to create another matrix (25x100), for

Re: [R] how to track a number in a row

2010-01-11 Thread David Winsemius
On Jan 11, 2010, at 10:16 PM, David Winsemius wrote: On Jan 11, 2010, at 9:38 PM, Márcio Resende wrote: Hi, I have a 100x15 matrix and in each row a set of 15 random numbers out of 25. for example: b - c(1:25) a -matrix(0,10,15) for (i in 1:10){ a[i,] - sample(b,15,replace = FALSE) }