R: what is NA_character_?
<pre><code>&gt;dput(dummy)
c(NA, "MGM", NA, "M", NA)

&gt;dummy
[1] NA    "MGM" NA    "M"   NA 

&gt;ifelse(dummy == "NA", 0, 1)
NA  1 NA  1 NA
</code></pre>

<p>I have a character vector, and I want to replace the <code>NA</code> values with 0 and everything else as 1. However, I have no idea what exactly these <code>NA</code> characters are? As you can see above they're not <code>"NA"</code>. When I tried <code>dput(dummy[1])</code> I get <code>NA_character_</code>. What can I do to get the ifelse statement to recognize those <code>NA</code>s?</p>