Description Usage Arguments Details Value Author(s) References See Also Examples
Set up ares environmental by cacching the data, formatting dates, creating holidays, and subsetting on data.
1 2 |
dataset |
the data frame for the analysis |
date.var |
string with the name of the column that holds the date variable. It should be a text variable or a factor |
weights |
an optional vector of weights to be used during the estimation process. See Details |
selection |
indicator variable for sub-setting. It can be either a quoted string with the name of a column in |
date.format |
a string indicating the date format for the horizontal axis. Default is |
weekday.ref |
a 3-letter string that match the reference weekday in the U.S. English locale. For example, "Mon" for Monday. Default is "Sun" |
holidays |
logical indicating if holidays should be created. Default is |
... |
further options for |
This function is intended to cache the dataset and set up some environment objects in R so the rest of the library can work properly. Although most of the functions can work stand alone, some of them depend on the object .ares.active.dataset
and .ares.selection
.
The argument weights
is an optional vector for weighting. Usually, it is a vector of ones if none is specified, but when the user has prior information about the weights of each observations, it can be set accordingly. It is particularly useful when the dataset has suffered some sort of imputation technique.
First, .ares.selection
is assigned to the global environment, then a date formatted variable is created from date.var
and a time index is generated. Factors for days of the week, months, quarters and years are defined. Indicator variables for holidays are created if holidays
is set to TRUE
. The holidays are created by gen_holidays
relying on the date variable. The date variable is defined as doe
that stands for "date of event". Country-specific holidays can be be generated on set up time for some countries. One can add these country-specific holidays by adding a file named "XX.hol"
to the "/R/library/ares/etc"
directory, where "XX" is a 2-letter abbreviation of the country name, for instance "BR.hol"
stands for the default option Brazil. The holidays file is self documented. Or you can simply send us an email with the holidays and the dates and we add it for you.
Finally, .ares.active.dataset
is assigned to the global environment, every instance of this data frame in the search path is removed and it is reattached.
Attention! The .ares.active.dataset
is replaced without warnings. Any changes made to it during a session that was not saved will be lost.
Note! Be warned that some functions were renamed in this version in order to avoid conflict with S3 methods, namely those starting with either plot. or print.. Please, change your scripts accordingly.
This function invisibly returns .ares.active.dataset
as a data frame.
Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
Schwartz, J., Spix, C., Touloumi, G. et al. (1996) Methodological issues in studies of air pollution and daily counts of deaths or hospital admissions. J Epidemiol. Community Health 50 (suppl 1), S12–S18.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.