Re: [R] writing a simple function

2008-02-13 Thread Roland Rau
Hi, Ben Bolker wrote: > Roland Rau gmail.com> writes: > >> does this do what you want? >> >> overlap <- function(a,b,c,d) { >> all(c:d %in% a:b) >> } >> overlap(1,5,3,4) >> overlap(1,2,3,4) > > Do you really want this to be discrete? How about > > overlap <- function(a,b,c,d) { >ad

Re: [R] writing a simple function

2008-02-13 Thread Ben Bolker
Roland Rau gmail.com> writes: > > does this do what you want? > > overlap <- function(a,b,c,d) { > all(c:d %in% a:b) > } > overlap(1,5,3,4) > overlap(1,2,3,4) Do you really want this to be discrete? How about overlap <- function(a,b,c,d) { ad } (although this assumes that ahttps:

Re: [R] writing a simple function

2008-02-13 Thread Bill.Venables
sage- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mohamed nur anisah Sent: Thursday, 14 February 2008 12:22 AM To: r-help@r-project.org Subject: [R] writing a simple function Dear lists, any suggestion on how to write a function to return a TRUE if interval [a,b] ove

Re: [R] writing a simple function

2008-02-13 Thread Roland Rau
Hi, mohamed nur anisah wrote: > Dear lists, > > any suggestion on how to write a function to return a TRUE if interval > [a,b] overlaps the interval [c,d]. I've tried it but an error occur saying > that 'could not find function v ; in addition warning message occur'. Below > is my codes.Pl

[R] writing a simple function

2008-02-13 Thread mohamed nur anisah
Dear lists, any suggestion on how to write a function to return a TRUE if interval [a,b] overlaps the interval [c,d]. I've tried it but an error occur saying that 'could not find function v ; in addition warning message occur'. Below is my codes.Please help me sort this problem as i'm in p