googmobility_skygrowth: Compute time series cross correlations and plots using google...

Description Usage Arguments Value Examples

View source: R/mobility0.R

Description

This function requires the pika package https://github.com/mrc-ide/pika/ NOTE this function computes the rolling correlation for a range of lag days, but does not currently use this information The lag data is returned. If R(t) is out of sync with mobility, better correlations can be found by shifting the dates of the R(t) data

Usage

1
googmobility_skygrowth(mobdf, sg0, region = "", regionshort = "")

Arguments

mobdf

A data frame with google mobility data for the selected region

sg0

Skygrowth output from function sarscov2::skygrowth0

region

A title for the plots describing the region of analysis

regionshort

A short title that will go in file names

Value

A list with the tabulated time series and outputs of pika::rolling_corr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# load the mobility data:
mobdf0 = read.csv( system.file( 'extdata/googmob-1may2020.csv', package = 'sarscov2' ) , stringsAs=FALSE)
# extract new york: 
mobdf <- mobdf0[ mobdf0$sub_region_1=='New York' & mobdf0$sub_region_2=='New York County', ]
# make a nice header for the plot
region = 'New York City, USA'
# run it: 
o = googmobility( mobdf, sg0, region = 'New York City, USA', regionshort='newyork'  )

## End(Not run)

emvolz-phylodynamics/sarscov2Rutils documentation built on Nov. 17, 2020, 9:22 a.m.