Re: [Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread murdoch
On 9/26/2005 10:29 AM, Peter Dalgaard wrote: > Duncan Murdoch <[EMAIL PROTECTED]> writes: > >> After foo<-list(), foo$bar is NULL, so we can simplify this. >> >> Here's a simpler version: >> >> # These work, which is a bit of a surprise, but there is some >> inconsistency: one x becomes a lis

Re: [Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread Duncan Murdoch
On 9/26/2005 10:29 AM, Peter Dalgaard wrote: > Duncan Murdoch <[EMAIL PROTECTED]> writes: > >> After foo<-list(), foo$bar is NULL, so we can simplify this. >> >> Here's a simpler version: >> >> # These work, which is a bit of a surprise, but there is some >> inconsistency: one x becomes a lis

Re: [Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread Peter Dalgaard
Duncan Murdoch <[EMAIL PROTECTED]> writes: > After foo<-list(), foo$bar is NULL, so we can simplify this. > > Here's a simpler version: > > # These work, which is a bit of a surprise, but there is some > inconsistency: one x becomes a list, the other is numeric: > > x <- NULL > > x[[1]] <-

Re: [Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread p . dalgaard
Duncan Murdoch <[EMAIL PROTECTED]> writes: > After foo<-list(), foo$bar is NULL, so we can simplify this. > > Here's a simpler version: > > # These work, which is a bit of a surprise, but there is some > inconsistency: one x becomes a list, the other is numeric: > > x <- NULL > > x[[1]] <-

Re: [Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread Duncan Murdoch
On 9/26/2005 7:34 AM, [EMAIL PROTECTED] wrote: > Full_Name: Jussi Jousimo > Version: 2.2.0 beta > OS: Windows XP > Submission from: (NULL) (193.167.195.60) > > > I'm trying to assign a zero length vector to a list: > > x<-numeric() > length(x) > foo<-list() > foo$bar[[1]]<-x > length(foo$bar[[1]

[Rd] Assigning a zero length vector to a list (PR#8157)

2005-09-26 Thread jussi . jousimo
Full_Name: Jussi Jousimo Version: 2.2.0 beta OS: Windows XP Submission from: (NULL) (193.167.195.60) I'm trying to assign a zero length vector to a list: x<-numeric() length(x) foo<-list() foo$bar[[1]]<-x length(foo$bar[[1]]) foo But in the list this vector turns out to be length one with rando