The Respiratory viruses weekly repository contains weekly summaries of the erviss data for Influenza-Like Illness (ILI) and Acute Respiratory Infection (ARI).
This vignette shows how to use (some of) this data through the
diseasystore
package.
First, it is a good idea to clone the repository locally and store that location as an option for the package.
# First we set the path we want to use as an option
options(
"diseasystore.DiseasystoreEcdcRespiratoryViruses.source_conn" =
file.path("local", "path")
)
# Ensure folder exists
source_conn <- diseasyoption("source_conn", "DiseasystoreEcdcRespiratoryViruses")
if (!dir.exists(source_conn)) {
dir.create(source_conn, recursive = TRUE, showWarnings = FALSE)
}
# Clone the repository
system2(
"git",
args = c(
paste("-C", source_conn),
"clone https://github.com/EU-ECDC/Respiratory_viruses_weekly_data"
),
stdout = TRUE
)
The diseasystores
require a database to store its
features in. These should be configured before use and can be stored in
the packages options.
# We define target_conn as a function that opens a DBIconnection to the DB
target_conn <- \() DBI::dbConnect(RSQLite::SQLite())
options(
"diseasystore.DiseasystoreEcdcRespiratoryViruses.target_conn" = target_conn
)
Once the files are downloaded and the target database is configured,
we can initialize the diseasystore
that uses the ECDC
Respiratory Viruses Weekly data.
Once configured such, we can use the feature store directly to get data.
If you have locally cloned the repository, you may consider pulling
data from the repository manually and disabling automatic pulls.
Otherwise, the diseasystore
will check for updates every
time you request a feature.