[R] How to preserve NULL in vector

Daren Tan darentan76 at gmail.com
Mon Apr 6 15:24:26 CEST 2009


I have a vector containing NULL. Referencing to that NULL gives me NA
instead, which disrupt my codes. How can i preserve NULL as it is ?

> res <- c(1,2,NULL)
> res[1]
[1] 1
> res[2]
[1] 2
> res[3]
[1] NA




More information about the R-help mailing list