Re: [R] help on loop function

From: <>
Date: Fri, 15 Feb 2008 10:14:54 -0600 (CST)

>From: mohamed nur anisah <>
>Date: 2008/02/15 Fri AM 07:13:15 CST
>Subject: [R] help on loop function

a similar ( if not identical ? ) question was asked a few days ago and the answer is at the link below.

>Dear lists,
> Anysuggestion on how to write a loop function which has nx2 matrix as an input, where each of the row represents an interval. the function should return a mx2 matrix containing the no matched interval of x?? i've tried my own function but it's only applies for 2x2 matrix.
> Here is my code:
> overlap<-function(x,y){
> for(i in 1:m){
> for(j in 1:n){
> if(x[i]>=y[j]) print(TRUE)
> else print(FALSE)
> }
> }
> }
> Many thanks!!
> Cheers,
> Anisah
> [[alternative HTML version deleted]]
> mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 15 Feb 2008 - 16:32:07 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 Fri 15 Feb 2008 - 17:30:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive