[R] Subsetting matrix with values from vector

Dimitris Rizopoulos d.rizopoulos at erasmusmc.nl
Tue Sep 15 16:54:13 CEST 2009


have a look at ?"%in%"


Best,
Dimitris


jorgusch wrote:
> Hello,
> 
> I have a large matrix (data), in which there is a column offerid. The values
> are numbers (lets say 1:5)
> There is another vector (idnew), which contains some of the offerids and
> many more (3:10).
> 
> I want a subset of the matrix wiith only those rows, which match the
> criteria of the vector.
> 
> How can I make it work?
> 
> Thanks!

-- 
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014




More information about the R-help mailing list