[R] time segments intersection

John Kane jrkrideau at yahoo.ca
Thu Oct 2 18:59:04 CEST 2008


help("%in%") may be of use. However I don't see any overlap in your example.


--- On Wed, 10/1/08, [Ricardo Rodriguez] Your XEN ICT Team <webmaster at xen.net> wrote:

> From: [Ricardo Rodriguez] Your XEN ICT Team <webmaster at xen.net>
> Subject: [R] time segments intersection
> To: r-help at r-project.org
> Cc: "Antonio Martinez Cortizas" <antonio.martinez.cortizas at usc.es>
> Received: Wednesday, October 1, 2008, 12:48 PM
> 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
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.



More information about the R-help mailing list