2-6 R语言基础 缺失值

#缺失值 Missing Value

> #NaN不可识别NA
> x <- c(1,NA,2,NA,3)


> is.na(x)
[1] FALSE TRUE FALSE TRUE FALSE


> is.nan(x)
[1] FALSE FALSE FALSE FALSE FALSE


> #NA可识别NaN
> y <- c(1,NaN,2,NaN,3)


> is.na(y)
[1] FALSE TRUE FALSE TRUE FALSE


> is.nan(y)
[1] FALSE TRUE FALSE TRUE FALSE

猜你喜欢

转载自www.cnblogs.com/hankleo/p/9942148.html