[R] How to detect NULL list element?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Nov 3 09:03:03 CET 2008


2008/11/3  <rkevinburton at charter.net>:

> So how do I detect the NULL at r[1]?

 How can you detect what is not there?

 Single square brackets on a list give you a list. Double square
brackets give you the elements.

 is.null(r[[1]]) should be TRUE.

Barry



More information about the R-help mailing list