periodicdummies: Make matrix of periodicity (e.g. seasonal) dummies

Description Usage Arguments Value Author(s) See Also Examples

View source: R/periodicdummies.R

Description

Auxiliary function that generates periodicity dummies (e.g. seasonal dummies) for regular time series. The function is similar to, but more general than, the seasonaldummy function in the forecast package.

Usage

1
periodicdummies(x, values=1)

Arguments

x

a regular time series (vector or matrix)

values

numeric of length 1 (default) or numeric vector of length equal to frequency(x)

Value

A matrix of class zoo with the periodicity dummies

Author(s)

Genaro Sucarrat, http://www.sucarrat.net/

See Also

is.regular, zooreg, zoo, ts

Examples

1
2
3
4
5
6
7
##quarterly dummies:
x <- zooreg(rnorm(30), start=2000, frequency=4)
periodicdummies(x)

##monthly dummies:
y <- zooreg(rnorm(30), start=c(2000,1), frequency=12)
periodicdummies(y)

gets documentation built on May 30, 2017, 4:09 a.m.

Search within the gets package
Search all R packages, documentation and source code