df.rm: Remove Time Series Components for Variables in a Data Frame

Description Usage Arguments See Also Examples

Description

This function removes given time series component(s) from selected columns in a data frame or data matrix. Each column in the data frame will be automatically converted to a time series object, and a decomposition process will then be applied to it. Users can choose to remove the seasonal component, the trend, or both components from the time series. A new data frame will be returned.

Usage

1
df.rm(df, index, rm="both", frequency=12)

Arguments

df

a data frame or matrix upon which the removal process is applied.

index

integers connected by a colon indicating which columns in the data frame should be considered. If ommitted, all columns are considered by default.

rm

a character indicating which time series component(s) should be removed. Options include "seasonal", "trend", and "both". Defualt is "both".

frequency

an integer indicating the frequency of the time series. Default is 12 for montly observations.

See Also

df.clean

Examples

1
2
data("US_Unemployment")
mydata<-df.rm(df=US_Unemployment, index=2:ncol(US_Unemployment))

google-trends-v1/gtm documentation built on June 5, 2019, 5:13 p.m.