[R] NA, where no NA should (could!) be!

Oliver Bandel oliver at first.in-berlin.de
Sat Dec 20 23:01:25 CET 2008


Sarah Goslee <sarah.goslee <at> gmail.com> writes:

> 
> I think we need the reproducible example requested in
> the posting guide.

====================
for ( datum in names(weblog_by_date) )
{ 
  print(datum)
  selected <- weblog_by_date[[datum]]

  res_size_by_host <- tapply( selected$size, selected$host, sum) 
  mycat <- function(a,b) cat(paste(a, "==>", b, "\n"))
  mapply( mycat, selected$size, selected$host )
  print( res_size_by_host )

  print( "is there any NA?!")
  print( any( is.na(selected$size)) )

}
====================



At the end of the printouts, it gives me:

=======================
 94.101.145.110     94.23.3.220 
             NA              NA 
[1] "is there any NA?!"
[1] FALSE
> 
=======================


Strange, eh?!

Ciao,
   Oliver



More information about the R-help mailing list