[R] 0.63 naming list elements

Dick Repasky drepasky at bio.indiana.edu
Wed Nov 18 16:58:42 CET 1998

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.

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