s-news
[Top] [All Lists]

Re: replace?

To: "Heymans, MW" <mw.heymans@vumc.nl>, s-news <s-news@lists.biostat.wustl.edu>
Subject: Re: replace?
From: "Richard M. Heiberger" <rmh@temple.edu>
Date: Mon, 17 Jul 2006 08:27:17 -0400 (EDT)
m <- data.frame(a=4:14, b=rnorm(11))
v <- c(4,10,7,12,7,10,11,11,12,7,4,7,12,11,10)

m$b[match(v, m$a)]

Read about subscripting with   ?"["
and about the match function   ?match

Please send directly executable code for your next query to the list.

Rich

<Prev in Thread] Current Thread [Next in Thread>