Re: [R] Factors and NaN

2014-12-05 Thread Lee, Chel Hee
'NaN' is a reserved keyword that implies 'Not a number'. I see that you use a character vector that includes 'NA' and 'NaN'. The former 'NA' is considered as a missing value; however, the latter 'NaN' is considered as a string 'NaN'. That's why three levels of 'NaN', 'no', 'yes' are shown.

Re: [R] Factors and NaN

2014-12-05 Thread David Winsemius
On Dec 5, 2014, at 7:16 AM, Dinesh Chowdhary wrote: > R-3.1.2 > >> x <- factor(c("yes", "yes", "no", NA, "yes", "no", NaN)) >> x > [1] yes yes noyes no NaN > Levels: NaN no yes >> is.nan(x) > [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE > >> From the above snippet can you notice that

[R] Factors and NaN

2014-12-05 Thread Dinesh Chowdhary
R-3.1.2 > x <- factor(c("yes", "yes", "no", NA, "yes", "no", NaN)) > x [1] yes yes noyes no NaN Levels: NaN no yes > is.nan(x) [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE >From the above snippet can you notice that the "NaN" value is not logically identified in a vector? Can anyone ela