Skip to content
Prev 69115 / 398502 Next

selections of data by one variable

try this:

d <- data.frame(a=1:10, b=11:20)
e <- c(13, 15, 17)
##############
d. <- subset(d, b %in% e)
d.


I hope it helps.

Best,
Dimitris

----
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm



----- Original Message ----- 
From: "Tu Yu-Kang" <yukangtu at hotmail.com>
To: <R-help at stat.math.ethz.ch>
Sent: Wednesday, May 04, 2005 1:14 PM
Subject: [R] selections of data by one variable