Description Usage Arguments Value
View source: R/analysis_functions.R
This function calculates the rolling correlation between two time series
1 | rolling_corr(dat, date_var = "date", grp_var, x_var, y_var, n = 14)
|
dat |
data frame with columns that correspond to two time series and grouping variable |
date_var |
character string of date column name (should be of class "Date") |
grp_var |
character string of column name in dat to be used as grouping variable |
x_var |
primary time series (should be a column in dat) |
y_var |
secondary time series (should be a column in dat) |
n |
the number of time periods over which to calculate rolling correlation |
tibble of lags by grp_var
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.