Description Usage Arguments Value Examples
tells if two ranges overlap
1 | rangesoverlap(r1, r2)
|
r1 |
a range a length 2 numerical vector |
r2 |
a range a length 2 numerical vector |
TRUE if two ranges overlap
1 2 3 4 5 6 7 8 | par(mfrow=c(1,4),oma=c(0,0,0,0))
set.seed(8);replicate(4,(function(){
r1<-sample(1:8,2);r2<-sample(1:5,2)
plot(cbind(c(r1,r2),0),yaxt='n',xlab='',ylab='',xaxt='n',
main=paste0(if(rangesoverlap(r1,r2)){"O"}else{"Does not o"},"verlap"))
points(cbind(r1,0),type="l",lwd=3)
points(cbind(r2,0),type="l",col="red")
})())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.