Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 1:20 PM, Peng Yu wrote: > On Fri, Dec 11, 2009 at 11:51 AM, Steve Lianoglou > wrote: >> >> On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: >> [snip] >> > What seems confusing to me is: > even 'x[i]<-list(NULL)' and 'x[[i]]<-list(NULL)' are different, why > x[i]<-NU

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:51 AM, Steve Lianoglou wrote: > > On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: > [snip] > What seems confusing to me is: even 'x[i]<-list(NULL)' and 'x[[i]]<-list(NULL)' are different, why x[i]<-NULL and x[[i]]<-NULL are the same? Shouldn't the m

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
On Dec 11, 2009, at 12:36 PM, Peng Yu wrote: [snip] >>> What seems confusing to me is: >>> even 'x[i]<-list(NULL)' and 'x[[i]]<-list(NULL)' are different, why >>> x[i]<-NULL and x[[i]]<-NULL are the same? >>> >>> Shouldn't the meaning of 'x[[i]]<-NULL' be defined as the set the i'th >>> element

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
On Fri, Dec 11, 2009 at 11:27 AM, Steve Lianoglou wrote: > Hi, > > On Dec 11, 2009, at 12:07 PM, Peng Yu wrote: > >> http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f >> >> The explanation on this FAQ entry is not clear. It says '... similarly >> for name

Re: [R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Steve Lianoglou
Hi, On Dec 11, 2009, at 12:07 PM, Peng Yu wrote: > http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f > > The explanation on this FAQ entry is not clear. It says '... similarly > for named components...'. What I understood was x[i]<-list(NULL) is > the s

[R] The correct way to set an element in a list to NULL? (FAQ is not clear)

2009-12-11 Thread Peng Yu
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-set-components-of-a-list-to-NULL_003f The explanation on this FAQ entry is not clear. It says '... similarly for named components...'. What I understood was x[i]<-list(NULL) is the same as x$a_name<-list(NULL). But, they are not. As the exampl