covid_lag: Covid Lag

Description Usage Arguments Value Examples

View source: R/sccwrpwbe_functions.R

Description

Covid Lag takes in Main 'data' which has an aggregate total of cases and will calculate lag differences between cases over 'n' days. Covid lag will also take in an offset value and shift the concentration measurements by 'offset' days to line up with the new case count. For example if offset = 7 concentration measurements recorded on '2020-04-20' will be shifted to align with new cases recorded on '2020-04-27'. In addition the CC parameter can be set to TRUE to take the difference in concentrations as well.

Usage

1
covid_lag(data, offset = 0, n = 1L, CC = F)

Arguments

data

Main data for Pt loma or Hyperion

offset

Number of days to shift concentrations

n

Number of days of differencing for running cases count to go to new cases

CC

CC = TRUE to also difference concentration n days

Value

Df with Cases_Offset column recording the new case count for the given day

Examples

1
2
# The following code shows the common way to use date_range and covid_lag to transform the data
Hyperion %>% date_range(start ='2020-04-20' , end = '2020-05-25') %>% covid_lag(offset =5 ,n=1, CC=F)

atki2828/sccwrpwbe documentation built on Dec. 19, 2021, 5:41 a.m.