Re: [R] match problem

2009-12-15 Thread Jim Holtman
?merge What is the problem you are trying to solve? Sent from my iPhone. On Dec 15, 2009, at 4:50, "Bunny, lautloscrew.com" > wrote: Hi all, I dont know if match is the right approach here. I´d like to match t o data.frames. One big dataframe and one small dataframe. In SQL, wh at i want

[R] match problem

2009-12-15 Thread Bunny, lautloscrew.com
Hi all, I dont know if match is the right approach here. I´d like to match to data.frames. One big dataframe and one small dataframe. In SQL, what i want to do what only be simple relation. The first consists of two columns a) some value b) some key that is explained in the other dataframe.

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

[R] match problem by rownames

2008-09-08 Thread Xianming Wei
Hi all, While dat['a1',] and dat['a10',] produce the same results in the following example, I'd like dat['a1',] to return NAs. dat <- data.frame(x1 = paste(letters[1:5],10, sep=''), x2=rnorm(5)) rownames(dat) <- dat$x1 dat['a1',] dat['a10',] > sessionInfo() R version 2.7.2 (2008-08-25) i386-pc-m