Skip to content
Prev 136570 / 398498 Next

writing a simple function

Hi,
Ben Bolker wrote:
you are absolutely right.[1]
I assume with discrete you mean integers?
I think the bigger problem with my function is that it makes way too 
many comparisons than are actually necessary (memory and time problems).

What about the following function:
overlap <- function(intval1, intval2) {
   (min(intval1) < min(intval2)) && (max(intval1) > max(intval2))
}

Best,
Roland

[1] I realized the problems with my solution almost as soon as I sent 
the email. But I was on a way to a meeting and there was no more time to 
correct it at that moment.