---
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of milton ruser
Sent: Wednesday, August 26, 2009 1:18 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] changing equal values on matrix by same ra
t; > From: r-help-boun...@r-project.org
> > [mailto:r-help-boun...@r-project.org] On Behalf Of milton ruser
> > Sent: Wednesday, August 26, 2009 9:54 AM
> > To: r-help@r-project.org
> > Subject: [R] changing equal values on matrix by same random number
> >
> > D
g
> Subject: [R] changing equal values on matrix by same random number
>
> Dear all,
>
> I have about 30,000 matrix (512x512), with values from 1 to N.
> Each value on a matrix represent a habitat patch on my
> matrix (i.e. my landscape). Non-habitat are stored as ZERO.
> No I ne
david.huf...@csosa.gov
> -
>
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of milton ruser
> Sent: Wednesday, August 26, 2009 1:18 PM
&g
--
>
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of milton ruser
> Sent: Wednesday, August 26, 2009 1:18 PM
> To: David Winsemius
> Cc: r-help@r-project.org
> Subject: Re: [
d.huf...@csosa.gov
-
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of milton ruser
Sent: Wednesday, August 26, 2009 1:18 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] changing equal values on matrix by same random number
Hi David,
Thanks for the reply. This is what I need:
> mymat[mymat==1] <- runif(1,min=0.4,max=0.7)
> mymat
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
[1,] 0.457316100200000 3 0
[2,] 0.457316100202000
On Aug 26, 2009, at 12:53 PM, milton ruser wrote:
Dear all,
I have about 30,000 matrix (512x512), with values from 1 to N.
Each value on a matrix represent a habitat patch on my
matrix (i.e. my landscape). Non-habitat are stored as ZERO.
No I need to change each 1-to-N values for the same rand
...@r-project.org] On
Behalf Of milton ruser
Sent: Wednesday, August 26, 2009 12:54 PM
To: r-help@r-project.org
Subject: [R] changing equal values on matrix by same random number
Dear all,
I have about 30,000 matrix (512x512), with values from 1 to N.
Each value on a matrix represent a habitat
Dear all,
I have about 30,000 matrix (512x512), with values from 1 to N.
Each value on a matrix represent a habitat patch on my
matrix (i.e. my landscape). Non-habitat are stored as ZERO.
No I need to change each 1-to-N values for the same random
number.
Just supose my matrix is:
mymat<-matrix(c(
10 matches
Mail list logo