Re: [R] Help wit matrices

2007-08-10 Thread Roland Rau
I hope you don't mind that I offer also two solutions. No.1 is really bad. No.2 should be on par with the other ones. Best, Roland mydata <- matrix(rnorm(10*10), ncol=10) threshold.value <- 1.5 mydata2 <- matrix(0, nrow=nrow(mydata), ncol=ncol(mydata)) mydata3 <- matrix(0, nrow=nrow(mydata),

Re: [R] Help wit matrices

2007-08-10 Thread Ted Harding
On 10-Aug-07 18:05:50, Lanre Okusanya wrote: > Hello all, > > I am working with a 1000x1000 matrix, and I would like to return a > 1000x1000 matrix that tells me which value in the matrix is greater > than a theshold value (1 or 0 indicator). > i have tried > mat2<-as.matrix(as.numeric(mat1>0.2

Re: [R] Help wit matrices

2007-08-10 Thread John Kane
Will something like this help? mm <- matrix(rnorm(100),nrow=10) mm nn <- mm >.5 nn --- Lanre Okusanya <[EMAIL PROTECTED]> wrote: > Hello all, > > I am working with a 1000x1000 matrix, and I would > like to return a > 1000x1000 matrix that tells me which value in the > matrix is greater > tha

Re: [R] Help wit matrices

2007-08-10 Thread Ravi Varadhan
mailto:[EMAIL PROTECTED] On Behalf Of Lanre Okusanya Sent: Friday, August 10, 2007 2:20 PM To: jim holtman Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Help wit matrices that was ridiculously simple. duh. THanks Lanre On 8/10/07, jim holtman <[EMAIL PROTECTED]> wrote: > Is this what yo

Re: [R] Help wit matrices

2007-08-10 Thread Henrique Dallazuanna
mat2<-matrix(as.numeric(mat1>0.25), ncol=1000) -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O On 10/08/07, Lanre Okusanya <[EMAIL PROTECTED]> wrote: > > Hello all, > > I am working with a 1000x1000 matrix, and I would like to return a > 1000x1000 matrix that tells me w

Re: [R] Help wit matrices

2007-08-10 Thread jim holtman
Is this what you want: > x <- matrix(runif(100), 10) > round(x, 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0.268 0.961 0.262 0.347 0.306 0.762 0.524 0.062 0.028 0.226 [2,] 0.219 0.100 0.165 0.131 0.578 0.933 0.317 0.109 0.527 0.131 [3,] 0.517 0.763 0.322 0.374 0.9

Re: [R] Help wit matrices

2007-08-10 Thread Lanre Okusanya
that was ridiculously simple. duh. THanks Lanre On 8/10/07, jim holtman <[EMAIL PROTECTED]> wrote: > Is this what you want: > > > x <- matrix(runif(100), 10) > > round(x, 3) >[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] > [1,] 0.268 0.961 0.262 0.347 0.306 0.762 0.524 0.06

[R] Help wit matrices

2007-08-10 Thread Lanre Okusanya
Hello all, I am working with a 1000x1000 matrix, and I would like to return a 1000x1000 matrix that tells me which value in the matrix is greater than a theshold value (1 or 0 indicator). i have tried mat2<-as.matrix(as.numeric(mat1>0.25)) but that returns a 1:10 matrix. I have also tried fo