From rgentlem@stat.auckland.ac.nz  Fri Apr 25 02:12:36 1997
From: rgentlem@stat.auckland.ac.nz (Robert Gentleman)
Date: Fri, 25 Apr 1997 13:12:36 +1200 (NZST)
Subject: R-alpha: list assignment
Message-ID: <199704250112.NAA00344@stat3.stat.auckland.ac.nz>


Peter,
  They don't work on purpose. Basically this is the same problem as indexing
beyond the end of an array. In almost all cases it is an error.
To add a variable with a specific name to a data frame how about

x (the dataframe)
var1 the variable
name1 the name

 x<-cbind(x,var1)
 names(x)[ncol(x)]<-name1


robert
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel 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-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: list assignment
Robert Gentleman