[R] 0.63 naming list elements

Dick Repasky (drepasky@bio.indiana.edu)
Wed, 18 Nov 1998 10:58:42 -0500 (EST)

Date: Wed, 18 Nov 1998 10:58:42 -0500 (EST)
From: Dick Repasky <drepasky@bio.indiana.edu>
Message-Id: <199811181558.KAA20803@sunflower.bio.indiana.edu>
To: r-help@stat.math.ethz.ch
Subject: [R] 0.63 naming list elements

The following used to work (0.62.1 the latest that I used), and now
it doesn't (0.63.0):

force <- vector(mode = "list", length = 1)
names(force)[1] <- somename

It returns the error:
Error in "[<-"(NULL, 1) : object is not subsetable

You might argue that this approach is unnecessary now that R allows
subscripts that are out of range (e.g., force<-list(); force[["name"]] <- 42)
but I changed a lot of code to work as above, and I really don't like
the idea of reverting.

Dick
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


This archive was generated by hypermail 1.02.