R-beta: logical indexing on a list

Robert Gentleman rgentlem at stat.auckland.ac.nz
Mon Aug 11 01:52:10 CEST 1997

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.
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 at stat.math.ethz.ch

More information about the R-help mailing list