df_epinow: Manipulate a dataset to use in an Epinow2 analysis

View source: R/df_epinow.R

df_epinowR Documentation

Manipulate a dataset to use in an Epinow2 analysis

Description

df_epinow manipulates a dataset provided by the user to a dataset readily usable for Epinow2 analyses

Usage

df_epinow(x, cases, date, regions, period = 14, regional = FALSE)

Arguments

x

a vertical dataset typically used in ecological analyses.

cases

the vector of cases in the provided dataset.

date

the vector of dates in the format yyyy-mm-dd in the provided dataset.

regions

if regional = TRUE, the vector of regions in the provided dataset.

period

numeric. How many date periods should be left into the dataset?

regional

logical. Does the user wants the dataset to be aggregated by regions?

Details

This function loads a data.frame object and makes some manipulation of it, in order to make it ready to be run in a Epinow2 local or regional analysis.

Examples

## Not run: 
library("epigraphhub")
con <- egh_connection(auto_connect = TRUE, use_env = TRUE, path_env = ".env")
df_canton <- dbGetQuery(con, "SELECT datum, \"geoRegion\", entries FROM switzerland.foph_cases")
df <- df_epinow(df_canton, cases = "entries", date = "datum", regions = "geoRegion", regional = TRUE, period = 28)

## End(Not run)

thegraphnetwork/r-epigraphhub documentation built on May 23, 2022, 7:45 p.m.