This will may work. Note that there is only one '&' instead of two.
try[try > 0.0 & try < 0.05]<-1
On Nov 27, 2007 12:37 PM, mogra <funnymoody999@yahoo.com> wrote:
>
> 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.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
=====================================T.K. (Tae-kyun) Kim
Ph.D. student
Department of Marketing
Marshall School of Business
University of Southern California
=====================================
[[alternative HTML version deleted]]