Skip to content
Prev 76609 / 398502 Next

Finding all overlaps between two sets of 1-Dimensional regions

maybe something like this could work in your case:

set1 <- t(apply(matrix(rnorm(20), 10, 2), 1, sort))
set2 <- t(apply(matrix(rnorm(10), 5, 2), 1, sort))
########################
set1. <- apply(set1, 1, rev)
apply(set2, 1, function(x) apply(set1. <= x, 2, any))


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.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


----- Original Message ----- 
From: "Sean Davis" <sdavis2 at mail.nih.gov>
To: "r-help" <r-help at stat.math.ethz.ch>
Sent: Friday, September 02, 2005 3:17 PM
Subject: [R] Finding all overlaps between two sets of 1-Dimensional 
regions
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm