growth.rate {covid19.analytics}R Documentation

function to compute daily changes and "Growth Rates" per location; "Growth Rates" defined as the ratio between changes in consecutive days

Description

function to compute daily changes and "Growth Rates" per location; "Growth Rates" defined as the ratio between changes in consecutive days

Usage

growth.rate(
  data0,
  geo.loc = NULL,
  stride = 1,
  info = "",
  staticPlt = TRUE,
  interactiveFig = FALSE,
  interactive.display = TRUE
)

Arguments

data0

data.frame with *time series* data from covid19

geo.loc

list of locations

stride

how frequently to compute the growth rate in units of days

info

additional information to include in plots' title

staticPlt

boolean flag to indicate whether static plots would be generated or not

interactiveFig

boolean flag to indicate whether interactice figures would be generated or not

interactive.display

boolean flag to indicate whether the interactive plot will be displayed (pushed) to your browser

Value

a list containing two dataframes: one reporting changes on daily baisis and a second one reporting growth rates, for the indicated regions

Examples

###\donttest{
# read data for confirmed cases
data <- covid19.data("ts-confirmed")
# compute changes and growth rates per location for all the countries
# growth.rate(data)
# compute changes and growth rates per location for 'Italy'
growth.rate(data,geo.loc="Italy")
# compute changes and growth rates per location for 'Italy' and 'Germany'
growth.rate(data,geo.loc=c("Italy","Germany"))
###}

[Package covid19.analytics version 2.1.3.3 Index]