Description Usage Arguments Details Value Examples
Sample an input zoo
onto a monthly frequency.
1 | sampleZooMonthly(x, register = c("first", "last"))
|
x |
An input |
register |
Flag to indicate where to register the output: Either 'first' or 'last' |
Sub-sample a zoo
from (usually) daily to a monthly frequency. Register
the output on either first or last day of the month. This simply extracts
the records from the input that are closest to either the beginning or ending
day of each month covered. It's a "coarsening" of a zoo
with a
frequency higher than monthly (e.g. daily to monthly).
A zoo
1 2 3 4 5 6 7 8 9 10 11 12 | library(zoo)
dts1 <- seq(as.Date("2012-08-01"), as.Date("2013-09-30"), "days")
dts2 <- seq(strptime("20120801", "\%Y\%m\%d"),
strptime("20130930", "\%Y\%m\%d"), "day")
nr <- length(dts1)
z1 <- zoo(matrix(rnorm(nr*4), nr, 4), dts1)
z2 <- zoo(matrix(rnorm(nr*4), nr, 4), dts2)
sampleZooMonthly(z1)
sampleZooMonthly(z2, "last")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.