Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread tlumley
It is perhaps also worth mentioning that this is the very first question in the actual R questions section of the R FAQ. 7.1 How can I set components of a list to NULL? You can use x[i] <- list(NULL) to set component i of the list x to NULL, similarly for named components. Do not set

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread Jim Lemon
On 10/25/2009 03:43 PM, mau...@alice.it wrote: I can define a list containing NULL elements: myList<- list("aaa",NULL,TRUE) names(myList)<- c("first","second","third") myList $first [1] "aaa" $second NULL $third [1] TRUE length(myList) [1] 3 However, if I assign NULL to

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread Ted Harding
[Apologies -- I inadvertently omitted an example, essential for clarity, from the examples below. Now corrected.] On 25-Oct-09 09:30:51, Ted Harding wrote: > On 25-Oct-09 09:52:42, Patrick Burns wrote: >> 'The R Inferno' page 59. >> >> Patrick Burns >> patr...@burns-stat.com >> +44 (0)20 8525 069

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread Ted Harding
On 25-Oct-09 09:52:42, Patrick Burns wrote: > 'The R Inferno' page 59. > > Patrick Burns > patr...@burns-stat.com > +44 (0)20 8525 0696 > http://www.burns-stat.com > (home of "The R Inferno" and "A Guide for the Unwilling S User") Which essentially says that If you want the component [x1[comp

Re: [R] NULL elements in lists ... a nightmare

2009-10-25 Thread Patrick Burns
'The R Inferno' page 59. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of "The R Inferno" and "A Guide for the Unwilling S User") mau...@alice.it wrote: I can define a list containing NULL elements: myList <- list("aaa",NULL,TRUE) names(myList) <- c