Re: [R] "Holes" in a data frame with time intervals

2011-03-28 Thread Henrique Dallazuanna
Try this: dif <- na.omit(c(DF$STARTDATE[-1], NA) - DF$ENDDATE) list(DF$ENDDATE[dif != 1] + 1, DF$ENDDATE[dif != 1] + (dif[dif != 1] - 1)) On Mon, Mar 28, 2011 at 8:56 AM, wrote: > Good morning, > > > > I am facing a problem very easy to solve with a program, but not too > easy (at least IMHO)

Re: [R] "Holes" in a data frame with time intervals

2011-03-28 Thread jim holtman
Does this do what you want: > x <- read.table(textConnection("B1 A15 30 > 2001-01-01 2001-10-15 + B1 A15 28 2001-10-16 2001-12-31 + B1 A15 32 2002-01-01 2003-04-18 + B1 A15 33 2003-04-19 20

[R] "Holes" in a data frame with time intervals

2011-03-28 Thread ANGELO.LINARDI
Good morning, I am facing a problem very easy to solve with a program, but not too easy (at least IMHO) with a "declarative" approach. I have a dataframe df with some information about bank branches with a validity time associated (start date/end date, format -MM-DD) to some attributes (fo