Skip to content

is.null(mylist[1]) and is.null(mylist$a) returns different values

1 message · ce

ce
#
Thank you all , very informative, never thought of doing a str( mylist[1] )  

-----Original Message-----
From: "Jeff Newmiller" [jdnewmil at dcn.davis.ca.us]
Date: 06/15/2017 11:56 AM
To: r-help at r-project.org, "Huzefa Khalil" <huzefa.khalil at umich.edu>, "ce" <zadig_1 at excite.com>
Subject: Re: [R] is.null(mylist[1]) and is.null(mylist$a) returns different	values

I find that the str function is more helpful for understanding the difference between a null list and a list containing a null list than the implicit print function call that the interpreter invokes when you enter an expression at the console. 

str( mylist[1] )