[R] conditional matching of rows of tables

From: Ng Stanley <stanleyngkl_at_gmail.com>
Date: Thu, 20 Mar 2008 19:07:48 +0800


Hi,

Given matrix A of 4 cols.

1 a 0 4
1 b 5 8
2 a 0 3
2 b 4 7

I have another matrix B of 3 cols. How to assign (a or b) to the rows such that in each row its 1st value must match the 1st col. of A, 2nd and 3rd values must lie between 3rd and 4rd cols (inclusive) of A

1 2 3 -> a
2 4 5 -> b
2 0 3 -> a
1 7 8 -> b

	[[alternative HTML version deleted]]

______________________________________________
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. Received on Thu 20 Mar 2008 - 11:19:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Mar 2008 - 17:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive