build_data: Create a data object from dataframes.

View source: R/data-fcts.R

build_dataR Documentation

Create a data object from dataframes.

Description

User provides dataframes that records the number of cases, (optionally) hospital admissions and viral concentration in wastewater for a specific location. The various data source do not have to have matching date.

Usage

build_data(cases, hosp, ww, hosp.type, case.date.type)

Arguments

cases

Dataframe with two columns named date and value that records the number of cases with respect to time.

hosp

Dataframe with two columns named date and value that records the number of hospitalizations with respect to time.

ww

Dataframe with two columns named date and value that records the viral concentration in wastewater with respect to time.

hosp.type

String. Type of hospitalization provided in path.hosp: NULL, 'hosp.adm' for hospital admissions, 'hosp.occ' for hospital occupancy.

case.date.type

String. Type of date which cases are based on: 'report' for reported date and 'episode' for episode date (date of symptoms onset).

Value

A list of dataframes.

Examples


# Load data sets examples from `wem` package:
data('cases')
data('hosp')
data('wwviralconc')

# Build the data object:
dat = build_data(cases = cases, 
                 hosp = hosp, 
                 ww = wwviralconc, 
                 hosp.type = 'hosp.adm', 
                 case.date.type = 'report')


phac-nml-phrsd/wem documentation built on June 6, 2024, 11:06 p.m.