getid_: Gets Infectious Diseases

Description Usage Arguments Details Value Examples

View source: R/merging_function.R

Description

Merges epidemiological data accordingly to a time range and merges the provinces concerned by a split/combined event if necessary and returns a data frame for the time range imputed.

Usage

1
2
3
getid_(..., from, to, shortest = FALSE)

getid(..., from, to, shortest = FALSE)

Arguments

...

Name of one or multople disease (e.g. ili, dengue ...).

from

Initial date of the time range, can be an object of class Date, character or numeric.

to

Final date of the data, of the class Date, character or numeric.

shortest

if FALSE, the time range selected contains all the data from all the diseases (by default). If TRUE: starts when all the diseases have data and ends as soon as one disease as no more available data. (selects the overlaps year)

Details

One dataset called diseases contains the description of all the epidemiological data frames available in this package. The data frame is ordered by the names of each disease and the time range of the data. This table can be used as a resume.

The time range can be implemented in the function by three different ways : from, to and shortest.

In each epidemiological data frame, the incidence corresponds to the number of new cases and the mortality corresponds to the number of deaths.

Before 1991, <NA> corresponds to "no case" or "no report". After 1991, <NA> corresponds to "no report" and 0 to "no case".

For two diseases: hepatitis and amoebiasis, the story of splits/combined province is different. The merges events of 1990 take place in 1991. Another list of event has been created for these two diseases and if one or the two of them are selected (together with other diseases), this story will be applied to all the disease selected.

Value

An object of the class data frame in which all the provinces that needed to be merged (according to the time range provided) are merged together and contains also the variables year, month and incidence and mortality for each disease asked.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Loads the resume table of all the epidemiological data frame contains in
# the package.
diseases

# Returns a data frame in which all the provinces that needed to be merged
# (according to the time range) are merged. By default, the time range
# selected is the one containing the data for all the diseases.
getid_("dengue")
getid(hepatitis)
getid_("cholera", "malaria", "ili") # time range: 1980-01-01 to 2015-12-31
getid(dengue, chickenpox, anthrax) # time range: 1980-01-01 to 2015-12-31

# If shortest = TRUE, the time range selected is the one
# containing overlaps data per year, for example the malaria data start
# in 2003, the years before will not be selected. And, it is the same for
# dengue, the data stop at 2010, so the years after will not be selected.
getid_("cholera", "malaria", "ili", shortest = TRUE)
# time range: 2003-01-01 to 2015-12-31
getid(dengue, chickenpox, anthrax, shortest = TRUE)
# time range: 1990-01-01 to 2010-12-31

# For the time range, the year can also be entered as parameters:
# As numeric or character and by default, the first day of the year "from"
# and the last day of the year "to" will be selected as time range.
getid_("dengue", "ili", "cholera", from = 1990, to = 2004)
getid(chickenpox, anthrax, from = "1980" , to = "2009")
# Or directly as Date
getid_("dengue", "ili", "cholera", from = "1990-01-01", to = "2004-12-31")
getid(chickenpox, anthrax, from = "1980-01-01" , to = "2009-12-31")

choisy/gdpm documentation built on July 24, 2019, 2:58 p.m.