Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread Charles C. Berry
--- -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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread William Dunlap
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
-- > > > -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: [

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Huffer
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Winsemius
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

Re: [R] changing equal values on matrix by same random number

2009-08-26 Thread David Huffer
...@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

[R] changing equal values on matrix by same random number

2009-08-26 Thread milton ruser
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(