[R] where are these NAs coming from?

Duncan Murdoch murdoch.duncan at gmail.com
Wed Sep 19 20:06:11 CEST 2012


On 19/09/2012 1:50 PM, Sam Steingold wrote:
> I see this:
> --8<---------------cut here---------------start------------->8---
> > length(which(is.na(z$language)))
> [1] 0
> > locals <- z[z$country == mycountry,]
> > length(which(is.na(locals$language)))
> [1] 229
> --8<---------------cut here---------------end--------------->8---
> where are those locals without the language coming from?!
>
Why not look?  z may be big, but

which(is.na(locals$language))

only contains 229 values, and you could look at the z rows for those (or the first few of them if 229 is too many).

Duncan Murdoch




More information about the R-help mailing list