I have a table with different dates for id\_client. I need to create a table with **all** dates between maximum and minumun date of each client. For example, my table would be:

```
tbl<-data.frame(id_cliente=c(1,1,1,1,2,3,3,3), 
                fecha=c('2013-01-01', '2013-06-01','2013-05-01', '2013-04-01', 
                        '2013-01-01', '2013-01-01','2013-05-01','2013-04-01'))

tbl$fecha<-as.Date(as.character(tbl$fecha))

```

I need to end up with a table like:

```
id_cliente  fecha
1   01/01/2013
1   01/02/2013
1   01/03/2013
1   01/04/2013
1   01/05/2013
1   01/06/2013
2   01/01/2013
3   01/01/2013
3   01/02/2013
3   01/03/2013
3   01/04/2013
3   01/05/2013

```

I thought I could use ddply (plyr package), so I created a function that gets the sequence of months:

```
meses<-function(xMin, xMax){ 
  seq(from=as.Date(xMin, , '%Y-%m-%d'), to=as.Date(xMax, '%Y-%m-%d'), by='month')}

```

Then I apply ddply:

```
library(plyr)
vf<-ddply(tbl, .(id_cliente), summarize, maxF=max(fecha), minF=min(fecha), 
                 sec=list(meses(xMin=minF, xMax=maxF)))

```

But my table is:

```
> vf
  id_cliente       maxF       minF                                      sec
1          1 2013-06-01 2013-01-01 15706, 15737, 15765, 15796, 15826, 15857
2          2 2013-01-01 2013-01-01                                    15706
3          3 2013-05-01 2013-01-01        15706, 15737, 15765, 15796, 15826

```

Dates stored in the list are transformed to numbers.

I know I can transform a number to a date. So:

```
convFecha<-function(x){as.Date(x, origin='1970-01-01')}

```

And then I used lapply:

```
lapply(vf$sec, convFecha)

```

And I get the desired result:

```
[[1]]
[1] "2013-01-01" "2013-02-01" "2013-03-01" "2013-04-01" "2013-05-01" "2013-06-01"

[[2]]
[1] "2013-01-01"

[[3]]
[1] "2013-01-01" "2013-02-01" "2013-03-01" "2013-04-01" "2013-05-01"

```

At this point I dont know how to create the final table. If I try to paste this result to my table it transforms the dates again in numbers.

```
vf$sec1<-lapply(vf$sec, convFecha)

```

So, do I have to paste these dates to each row of vf ? Is there any other way yo get the desired table? What would be the next step to reach the table needed?