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

Description Usage Arguments Value Author(s) See Also Examples

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)


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

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.