There is a new FAQ #13 in the zoo-faq vignette in the development
version of the zoo package which illustrates several approaches to
this (all of which work in the current version of zoo as well). See:
http://pages.citebite.com/l2m2b3i4k5fnv
On Mon, Mar 15, 2010 at 1:02 PM, Joe Calderon wrote:
Try this:
x
V1 V2
1 2010-03-01 9
2 2010-03-03 17
3 2010-03-04 2
4 2010-03-05 9
5 2010-03-07 3
rng <- range(as.Date(x$V1))
with(merge(data.frame(V1 = seq(rng[1], rng[2], by = 'day')),
x, all = TRUE), aggregate(V2, list(V1), FUN = sum, na.rm = TRUE))
On Mon, Mar 15, 2010 at 2
hello *, im new to the list (and R in general), i have a problem that
im hoping someone can help me solve. i have data that i want to turn
into a time series per day,
ex.
2010-03-01 9
2010-03-03 17
2010-03-04 2
2010-03-05 9
2010-03-07 3
is there an easy way to fill in the gaps for the m
If you are using zoo for this you can do:
library(zoo)
set.seed(1)
x <- zoo(rnorm(7), as.numeric(1:7))
y <- zoo(rnorm(4), c(1, 2, 6, 7))
xy <- merge(x,y)
xy$y - xy$x
# or if you just want the difference at times existing in both
y - x
On Sat, Aug 2, 2008 at 5:16 PM, <[EMAIL PROTECTED]> wrote:
R does not allow 'gaps' in its class "ts".
Irregular time series are covered in several packages, including tseries,
its and zoo.
On Sat, 2 Aug 2008, [EMAIL PROTECTED] wrote:
I like the fact that in subtracting two time series objects that there
is some effort to align the series. So if I ha
I like the fact that in subtracting two time series objects that there is some
effort to align the series. So if I have a time series of that begins at 1 and
one that begins at 2 a subtraction operation makes sure that the proper values
are subtracted. But I am unclear as to the best way to buil
6 matches
Mail list logo