rolling_corr: Calculate rolling correlation between two time series by...

Description Usage Arguments Value

View source: R/analysis_functions.R

Description

This function calculates the rolling correlation between two time series

Usage

1
rolling_corr(dat, date_var = "date", grp_var, x_var, y_var, n = 14)

Arguments

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

Value

tibble of lags by grp_var


mrc-ide/pika documentation built on May 18, 2020, 8:55 p.m.