Re: R-beta: logical indexing on a list

Robert Gentleman (rgentlem@stat.auckland.ac.nz)
Mon, 11 Aug 1997 11:52:10 +1200 (NZST)


Date: Mon, 11 Aug 1997 11:52:10 +1200 (NZST)
From: Robert Gentleman <rgentlem@stat.auckland.ac.nz>
Message-Id: <199708102352.LAA19451@stat1.stat.auckland.ac.nz>
To: r-help@stat.math.ethz.ch
Subject: Re: R-beta: logical indexing on a list

Content-MD5: /M9s6thO18aUQtyRl+Nb5g==
Sender: owner-r-help@stat.math.ethz.ch
Precedence: bulk

Doug Bates reports the problem:

  tt <- list(foo = 1, bar = 2)
  
  > tt[c(F,F)]
Error: attempt to set an attribute on NULL

The problem is that in R there is only one NULL and if attributes are
set on it they appear in all instances of NULL which is a bit undesireable.
This problem will go away once we get generic vectors going. In the meantime,
changing line 184 of src/main/subset.c to only carry out the attribute
assignment when result != R_NilValue  will take care of it. This will be
distributed with the next set of patches.
   robert
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=