Learn R Programming

covid19.analytics (version 2.1.3.3)

tots.per.location: function to compute totals per location

Description

function to compute totals per location

Usage

tots.per.location(
  data,
  geo.loc = NULL,
  confBnd = FALSE,
  nbr.plts = 1,
  info = ""
)

Value

a list or dataframe with totals per specified locations and type of case

Arguments

data

data.frame with *time series* data from covid19

geo.loc

list of locations

confBnd

flag to activate/deactivate drawing of confidence bands base on a moving average window

nbr.plts

parameter to control the number of plots to display per figure

info

additional info to display in plots' titles

Examples

Run this code

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

Run the code above in your browser using DataLab