Learn R Programming

BCDating (version 0.9.8)

avgts: TimeSeries averages over cycle phases.

Description

This function returns the averages of the input time series over each of phases in the Dating. It omits the NA's in the time series, so will give an error with internal NA's.

Usage

avgts(ts,Dating)

Arguments

ts

The input time series.

Dating

The dating.

Value

A ts timeseries.

Examples

Run this code
# NOT RUN {
data("Iran.non.Oil.GDP.Quarterly.Growth")
data("MBRI.Iran.Dating")
avggrowth <- avgts(Iran.non.Oil.GDP.Quarterly.Growth,MBRI.Iran.Dating)
cbind(avggrowth,Iran.non.Oil.GDP.Quarterly.Growth)
plot(MBRI.Iran.Dating,avggrowth)
plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Quarterly.Growth,averages=TRUE)









# }

Run the code above in your browser using DataLab