Re: [R] identify time span in date vector

2012-04-04 Thread David Winsemius
length greater than 3 but that should not be difficult. > intervals1[which( sapply(intervals1, function(x) x[length(x)-1] - x[1] >90 & length(x) >3)) ][[1]][1] [1] "2001-01-03" -- David. Best, Felix -Ursprüngliche Nachricht- Von: Petr PIKAL [mai

Re: [R] identify time span in date vector

2012-04-04 Thread Petr PIKAL
-Ursprüngliche Nachricht- > Von: Petr PIKAL [mailto:petr.pi...@precheza.cz] > Gesendet: Mittwoch, 4. April 2012 09:47 > An: Fischer, Felix > Cc: r-help@r-project.org > Betreff: Odp: [R] identify time span in date vector > > Hi > > Can you please be more specific? Based

Re: [R] identify time span in date vector

2012-04-04 Thread Fischer, Felix
ht- Von: David Winsemius [mailto:dwinsem...@comcast.net] Gesendet: Dienstag, 3. April 2012 19:08 An: Fischer, Felix Cc: r-help@r-project.org Betreff: Re: [R] identify time span in date vector On Apr 3, 2012, at 9:35 AM, Fischer, Felix wrote: > Hello everyone, > > i try to identify

Re: [R] identify time span in date vector

2012-04-04 Thread Fischer, Felix
det: Mittwoch, 4. April 2012 09:47 An: Fischer, Felix Cc: r-help@r-project.org Betreff: Odp: [R] identify time span in date vector Hi Can you please be more specific? Based on this input, what do you want as a result? > set.seed(111) > dates = as.Date(sort(rnorm(10,3000,100)), origin =

Re: [R] identify time span in date vector

2012-04-03 Thread David Winsemius
On Apr 3, 2012, at 9:35 AM, Fischer, Felix wrote: Hello everyone, i try to identify the first element of a date vector, for which the following condition holds: at least 3 more dates within the next 365 days, but at least one of these must be between 3-12 month later. dates = as.Date(sor

[R] identify time span in date vector

2012-04-03 Thread Fischer, Felix
Hello everyone, i try to identify the first element of a date vector, for which the following condition holds: at least 3 more dates within the next 365 days, but at least one of these must be between 3-12 month later. dates = as.Date(sort(rnorm(10,3000,100)), origin = "2000-1-1") Has anyone a