Re: [R] match problem by rownames

2008-09-09 Thread Dimitris Rizopoulos
try this: dat <- data.frame(x1 = paste(letters[1:5],10, sep=''), x2=rnorm(5)) row.names(dat) <- dat$x1 dat['a1' %in% row.names(dat), ] dat['a10' %in% row.names(dat), ] I hope it helps. Best, Dimitris > Hi all, > > While dat['a1',] and dat['a10',] produce the same results in the > following

Re: [R] match problem by rownames

2008-09-09 Thread Charilaos Skiadas
As suggested in ?"[.data.frame", try: dat[match('a1', rownames(dat)),] Haris Skiadas Department of Mathematics and Computer Science Hanover College On Sep 9, 2008, at 2:41 AM, Xianming Wei wrote: Hi all, While dat['a1',] and dat['a10',] produce the same results in the following example, I'd