R-alpha: ?bug in [.data.frame

Thomas Lumley Thomas Lumley <thomas@biostat.washington.edu>
Sun, 31 Aug 1997 12:34:59 -0700 (PDT)


If you subscript a data frame using the names of the columns and there is
more than one column with the same name only the first one is found.
eg
	mm<-data.frame(1:10,log(1:10))
	names(mm)<-c("(offset)","(offset)")
	mm[,"(offset)"]			# only returns first column
	mm[,"(offset)"]<-rep(1,10)	# only sets first column

This *is* compatible with S, but I still think it's the wrong thing to do.


Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-