[R] is.null(mylist) and is.null(mylist$a) returns different values
jdnewmil at dcn.davis.ca.us
Thu Jun 15 17:56:37 CEST 2017
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 )
Sent from my phone. Please excuse my brevity.
On June 15, 2017 8:39:47 AM PDT, Huzefa Khalil <huzefa.khalil at umich.edu> wrote:
>Notice the double square brackets.
>"The most important distinction between [, [[ and $ is that the [ can
>select more than one element whereas the other two select a single
>On Thu, Jun 15, 2017 at 11:33 AM, ce <zadig_1 at excite.com> wrote:
>> I have a list :
>> mylist <- list( a = NULL, b = 1, c = 2 )
>>  FALSE
>>  TRUE
>> why? I need to use mylist
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help