Dear All,
Many thanks for all your useful suggestions. Much appreciated.
Jos
2009/5/28 David Winsemius :
> Your last step will either be a single number (not really a sampling
> operation) or a
> non-positive number. So at best you really only have an number that depends
> entirely on the prior
Your last step will either be a single number (not really a sampling
operation) or a
non-positive number. So at best you really only have an number that
depends
entirely on the prior sequence of draws.
--
David.
On May 28, 2009, at 8:21 AM, jos matejus wrote:
Dear Ritchie and David,
Thank
This is one way of sampling all the values in the matrix that meet your
criteria:
> set.seed(1)
> (x <- matrix(rnorm(100), 10))
[,1][,2][,3][,4] [,5]
[,6][,7] [,8] [,9] [,10]
[1,] -0.6264538 1.51178117 0.91897737 1.35867955 -
Dear Ritchie and David,
Thanks very much for your advice. I had thought of this potential
solution, however it doesn't really fullfill my second criteria which
is that once a particular cell has been sampled, the row and column of
that cell can't be sampled from subsequently. In other words, the n
On May 28, 2009, at 6:33 AM, jos matejus wrote:
Dear R users,
I have a matrix of both negative and positive values that I would like
to randomly sample with the following 2 conditions:
1. only sample positive values
2. once a cell in the matrix has been sampled the row and column of
that cell
> I have a matrix of both negative and positive values that I would like
> to randomly sample with the following 2 conditions:
>
> 1. only sample positive values
> 2. once a cell in the matrix has been sampled the row and column of
> that cell cannot be sampled from again.
>
> #some dummy data
>
Dear R users,
I have a matrix of both negative and positive values that I would like
to randomly sample with the following 2 conditions:
1. only sample positive values
2. once a cell in the matrix has been sampled the row and column of
that cell cannot be sampled from again.
#some dummy data
set
7 matches
Mail list logo