Use any(is.na(...)) instead of anyNA, for R < 3.0.2 compatibility