Hi,

I have a data.frame like this:

y <- rnorm(60)
lev <- gl(3,20, labels=paste("lev", 1:3, sep=""))
date1 <- as.Date(seq(ISOdate(2007,9,1), ISOdate(2007,11,5),
by=60*60*24))
date1 <- date1[-c(3,4,15,34,38,40)]
df <- data.frame(lev=lev, date1=date1, y=y)

I would like to produce a new data.frame with missing days in df$date1
in each df$lev, like this:

    lev      date1           
1  lev1 2007-09-03 
2  lev1 2007-09-04 
3  lev1 2007-09-15 
4  lev2 2007-09-01
5  lev2 2007-09-02 
etc.

How can I do this?

Thanks,
Lauri
FRCBS



        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to