Skip to content
Prev 240969 / 398500 Next

Question regarding to replace <NA>

On Tue, Nov 9, 2010 at 9:43 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:
Last correction (I promise).  Somehow I tested incorrectly which lead
to me to my two erroneous statements before.  is.na() works just fine
with data frames.  It was just the factor issue (as Phil said).
a  b  d    e
1 1  1 NA <NA>
2 2  2  2 <NA>
3 3 NA  3    1
Warning message:
In `[<-.factor`(`*tmp*`, thisvar, value = 0) :
  invalid factor level, NAs generated
a b d    e
1 1 1 0 <NA>
2 2 2 2 <NA>
3 3 0 3    1

off-to-hide-under-a-rock-Josh