[Rd] Row subsetting of data frames (PR#425)

plummer@iarc.fr plummer@iarc.fr
Wed, 9 Feb 2000 18:38:12 +0100 (MET)


If you want to use row names to take a row subset of a data.frame then
there is a bug when
- One row has a name which is a completion of another row name
- The shorter name comes after the longer one
- You want to retrieve the row with the shorter name

An example:

R> x <- matrix(1:4, 2, 2, dimnames=list(c("abc","ab"), c("cde","cd")))
R> x
    cde cd
abc   1  3
ab    2  4
R> x["ab",]                       #Works OK for matrices
cde  cd 
  2   4 
R> y <- as.data.frame(x)
R> y["ab",]                       #but not for a data frame
    cde cd
abc   1  3

--please do not edit the information below--

Version:
 platform = i686-unknown-linux
 arch = i686
 os = linux
 system = i686, linux
 status = Patched
 major = 0
 minor = 99.0
 year = 2000
 month = February
 day = 9
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base

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