Learn R Programming

gets (version 0.38)

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

Description

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

Usage

periodicdummies(x, values=1)

Value

A matrix of class zoo with periodicity dummies

Arguments

x

a regular time series (vector or matrix)

values

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

Author

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

See Also

Examples

Run this code
##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)

Run the code above in your browser using DataLab