[R] Re place values in Data matrix

mogra funnymoody999 at yahoo.com
Tue Nov 27 21:37:54 CET 2007


I have data matrix and I want to replace values.

> try
        Rh.Rj      RR.Rj        RT.Rj
V1 0.08465125 0.19159688  0.617294468
V2 0.74853203 0.88826790  0.113979660
V3 0.68767961 0.17979307  0.013802852
V4 0.31722379 0.25611821 -0.021954454
V5 0.17931687 0.04491838  0.011484522
V6 0.87455663 0.16846121  0.002241211
V7 0.61770029 0.01090132  0.000079900
> try[try > 0.05]<-0
> try
   Rh.Rj      RR.Rj        RT.Rj
V1     0 0.00000000  0.000000000
V2     0 0.00000000  0.000000000
V3     0 0.00000000  0.013802852
V4     0 0.00000000 -0.021954454
V5     0 0.04491838  0.011484522
V6     0 0.00000000  0.002241211
V7     0 0.01090132  0.000079900

When I do  try[try > 0.0 && try < 0.05]<-1
it dose nothing .... is there syntax error in this?

Thanks a lot.



-- 
View this message in context: http://www.nabble.com/Replace-values-in-Data-matrix-tf4879255.html#a13963177
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list