[R] time segments intersection

[Ricardo Rodriguez] Your XEN ICT Team webmaster at xen.net
Wed Oct 1 18:48:43 CEST 2008


Hi all,

Please, how could I calculate the time that two time segments has in 
common? Is there any function to perform this calculation?

For instance, given four POSIXlt objects...

endPeriod<-as.POSIXlt("2008-09-30")
startPeriod<-as.POSIXlt("2007-10-01")
endProject<-as.POSIXlt("2007-05-31")
startProject<-as.POSIXlt("2006-12-01")

that limit two time segments...

project <- as.numeric(endProject-startProject)
period <- as.numeric(endPeriod-startPeriod)

How could I calculate the time project and period overlap?

Thanks for your help!

Ricardo



-- 
Ricardo Rodríguez
Your XEN ICT Team



More information about the R-help mailing list