I have created a vector in which both NA and NaN are present but when I have checked the NA in vector I get true for NaN but when I checked the NaN in a vector I get false for NA I am not able to understand it
 FALSE FALSE TRUE TRUE FALSE
 FALSE FALSE TRUE FALSE FALSE
Firstly, you must understand what NA and NaN mean:
- NA means that the entry is not present.
- NaN means that the entry is 0/0 i.e. it can’t be computed.
Thus, NaN is included as an NA which aids when arithmetic operations are to done on the vector by removing NA values.
On the other hand, is.nan() only returns the entries that are 0/0 for which an entry that is NA does not qualify.