I just do as.integer(NA), as.numeric(NA), as.character(NA), etc.
-- Tony Plate

On 5/5/2010 11:57 AM, Hadley Wickham wrote:
Hi all,

Is there an existing function that provides the correct type of
missing value for a given vector? e.g.

NAof(1:3) # NA_integer_
NAof(pi) # NA_real_
NAof("a") # NA_character_
NAof(T) # NA

?

Thanks,

Hadley



______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to