On Mar 31, 2014, at 1:29 PM, eliza botto <eliza_bo...@hotmail.com> wrote:
> Dear useRs, > Sorry for such a ridiculous question but i really need to know that what is > the difference between <NA> and NA and how to convert <NA> to NA. > Thankyou very much in advance > Eliza <NA> is the printed output that you would typically get when "NA" is an element in a factor: > factor(NA) [1] <NA> > is.na(factor(NA)) [1] TRUE > NA [1] NA > is.na(NA) [1] TRUE See ?factor for additional details. It is, other than the displayed output, the same as a 'normal' NA, which is to say that the value is missing and otherwise undefined. The behavior appears to evolve from the use of ?encodeString, which is called within print.factor: > encodeString(NA) [1] "<NA>" > encodeString(NA, na.encode = FALSE) [1] NA The default for the 'na.encode' argument is TRUE, so you get the formatting of the NA as you observe for factors. Regards, Marc Schwartz ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.