Re: [R] How to detect NULL list element?

From: Barry Rowlingson <>
Date: Mon, 03 Nov 2008 08:03:03 +0000

2008/11/3 <>:

> 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 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 03 Nov 2008 - 08:04:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 03 Nov 2008 - 09:30:21 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive