[R] Multiple missing values

2010-02-14 Thread John
Does anyone know, or know documentation that describes, how to declare multiple values in R as missing that does not involve coding them as NA? I wish to be able to treate values as missing, while still retaining codes that describe the reason for the value being missing. Thanks John MAcInnes

Re: [R] Multiple missing values

2010-02-14 Thread Gabor Grothendieck
NA, Inf, -Inf, NaN would give you 4 possibilities and is.finite would check if its any of them: x - c(1, NA, 2, Inf, 3, -Inf, 4, NaN, 5) is.finite(x) [1] TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE You might need to map them all to NA before using it with various functions depending

Re: [R] Multiple missing values

2010-02-14 Thread Patrick Burns
I can think of a few solutions, none perfect. * You could have a master dataset that has the missing value codes you want, and a dataset that you use which is a copy of it with real NA's in it. * You could add an attribute that gives the types of missing values in the various positions. The

Re: [R] Multiple missing values

2010-02-14 Thread Frank E Harrell Jr
Patrick Burns wrote: I can think of a few solutions, none perfect. * You could have a master dataset that has the missing value codes you want, and a dataset that you use which is a copy of it with real NA's in it. * You could add an attribute that gives the types of missing values in the

Re: [R] Multiple missing values

2010-02-14 Thread Joe King
...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Frank E Harrell Jr Sent: Sunday, February 14, 2010 9:39 AM To: Patrick Burns Cc: r-help@r-project.org; john.macin...@ed.ac.uk Subject: Re: [R] Multiple missing values Patrick Burns wrote: I can think of a few solutions, none

Re: [R] Multiple missing values

2010-02-14 Thread Jim Lemon
John wrote: ... Does anyone know, or know documentation that describes, how to declare multiple values in R as missing that does not involve coding them as NA? I wish to be able to treate values as missing, while still retaining codes that describe the reason for the value being missing. I