The zoo package's merge.zoo routines has a fill=0 argument so: create
an expanded index, ix, and then in the next line create zoo objects
from the data and the expanded index and merge them together. Finally
in the last line convert back to a data frame.
library(zoo)
ix <- with(frame, seq(min(V1
9 0.0
10 10 0.0
HTH ...
Peter Alspach
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Dan Kortschak
> Sent: Wednesday, 6 January 2010 11:40 a.m.
> To: r-help@r-pro
Hello,
I have a set of data frames, generated by an SQL query that I am working
with. Because of the way the query was written, zero values for the
dependent variable (V2 in the example) are not recorded. Up until now
this has not been a problem.
I would like to be able to fill all absent data wi
3 matches
Mail list logo