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

ce zadig_1 at excite.com
Thu Jun 15 17:33:00 CEST 2017


Hi

I have a list :

mylist <- list( a = NULL, b = 1, c = 2 )

> mylist[1]
$a
NULL

> is.null(mylist[1])
[1] FALSE

> is.null(mylist$a)
[1] TRUE

why? I need to use mylist[1] 


More information about the R-help mailing list