Hi,


I am trying to recode the output from a matrix(here is a small snippet of it):



HGlt10RawPerc2008[1:20]

 [1] -5

      0

     -1

     -1

      0

      2

      3

     -5

     -2

      0

      2

      0

      1

     -2

      3

      0

      4

      1

      4

      2



Here is the code I am using to recode it:



HGBlt10Points2008 = recode(HGlt10RawPerc ,"-100:0.0=10; 0:1.0=8; 1.001:3.0=6; 
3.001:4.0=4; 4.001:5.0=2;else=0 ")



The output that I am expecting and what I get are:


What it should be

     The output of
          my code

10

10

10

10

10

10

10

10

10

8

6

6

6

4

10

10

10

10

10

10

6

10

10

10

8

10

10

10

6

6

10

8

2

0

8

0

2

6

6

10




The differences between my output and what I wanted are bolded.. Any ideas on 
what I am doing wrong?  Thank you!!



Sincerely,



tom

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to