Description Usage Arguments Details Value Examples
View source: R/merging_function.R
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.
1 2 3 |
... |
Name of one or multople disease (e.g. |
from |
Initial date of the time range, can be an object of class
|
to |
Final date of the data, of the class |
shortest |
if |
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.
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.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.