[R] matrix - change values

robert-mcfadden at o2.pl robert-mcfadden at o2.pl
Thu Dec 14 15:01:16 CET 2006


Dear R Users,
I have a matrix A, and I want to change every value of this matrix if these values are greater than an assuming value. For a vector it is simple, e.g. a<-c(1:10); a[a>5]<-0. 
Of course, I can change matrix to vector, assign a value then change vector to matrix. But does there exist simpler way?
Any suggestion are appreciate.
Rob



More information about the R-help mailing list