set_month_to_NA: Set Periods to NA

Description Usage Arguments Examples

View source: R/set_month_to_NA.R

Description

This function is typically used to discard information in non-quarter month. I.e., data is only kept in January, April, July and December and otherwise set to NA. In combination with m_to_q this function is useful to turn monthly series into quarterly series by letting the quarter month values represent the entire quarter. This can be useful when data was interpolated because of mixing data of different frequencies and needs to be converted back to a regular, quarterly time series.

Usage

1
set_month_to_NA(series, keep_month = c(1, 4, 7, 10))

Arguments

series

ts object

keep_month

integer vector denoting the months that not be set to NA. Defaults to c(1,4,7,10)

Examples

1
2
3
tsq <- ts(1:20,start=c(1990,1),frequency = 4)
aa <- tsqm(tsq)
m_to_q(set_month_to_NA(aa))

tstools documentation built on May 2, 2019, 9:05 a.m.