[Rd] subset() only returns first of equally named columns from a data.frame (PR#9733)

From: <beierm_at_uni-duesseldorf.de>
Date: Wed, 13 Jun 2007 14:14:06 +0200 (CEST)

Full_Name: Manfred Beier
Version: 2.5.0 (2007-04-23)
OS: linux-gnu
Submission from: (NULL) (

When multiple columns in a data.frame have the same name, only the first of them is returned by the subset() function even when selected numerically.

> test <- data.frame(cbind(1,2,3))
> names(test) <- c("a","a","a")
> test

  a a a
1 1 2 3
> subset(test, TRUE, c(2,3))

  a a.1
1 1 1

For matrices subset() works correctly.

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 13 Jun 2007 - 13:47:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 13 Jun 2007 - 15:34:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.