Try this:
# test data
y <- 0:1000 # values
dd <- Sys.Date() + y # Dates
# create zoo object, aggregate it by year using last value and plot it
z <- zoo(y, dd)
yr <- function(x) as.POSIXlt(x)$year + 1900
# or, yr <- function(x) as.numeric(format(x, "%Y"))
z.yr <- aggregate(z, yr, tail, 1)
plot(z.
dear list,
i have a problem plotting revenue against the date.
the str. of date looks like:
Class 'Date' num [1:10493] -3649 -3648 -3647 -3646 -3643 ...
the head looks like:
[1] "1960-01-05" "1960-01-06" "1960-01-07" "1960-01-08" "1960-01-11"
[6] "1960-01-12"
i´d like to plot it against th