Skip to content
Prev 179388 / 398502 Next

subset data

data[data$id==selected$id, ] 


-------------------------
cuncta stricte discussurus
-------------------------

-----Urspr?ngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von abdul kudus
Gesendet: Wednesday, May 06, 2009 12:42 AM
An: r-help at r-project.org
Betreff: [R] subset data

Dear all,
id         x
1   1 0.3604464
2   2 0.4813987
3   3 0.0160058
4   4 0.7165909
5   5 0.6092248
6   6 0.2413049
7   7 0.7981568
8   8 0.6093960
9   9 0.2887064
10 10 0.3485780
[1] 9 7 1

I want to select data with corresponding selected.id, namely
id         x
9   9 0.2887064
7   7 0.7981568
1   1 0.3604464

How to do?

Tq.

Abdul Kudus
Institute for Mathematical Research
Universiti Putra Malaysia


______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.