Skip to content
Prev 228611 / 398500 Next

recoding problem

Hi Tom,

This seems to work like I'd expect:

HGlt10RawPerc2008 <- read.table(textConnection("
-5
 0
-1
-1
 0
 2
 3
-5
-2
 0
 2
 0
 1
-2
 3
 0
 4
 1
 4
 2
"))

recode(HGlt10RawPerc2008 ,"-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")

I wonder if your data might not be something like 10.0000001 which
would print as 10, but behave in calculations slightly differently?

Also, the output of this might be informative.

str(HGlt10RawPerc2008)

Cheers,

Josh
On Fri, Jul 23, 2010 at 7:47 AM, Heiman, Thomas J. <theiman at mitre.org> wrote: