| Title: | IIDDA API |
|---|---|
| Description: | R Bindings for the IIDDA API. |
| Authors: | Steve Walker [aut, cre] |
| Maintainer: | Steve Walker <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.5.0 |
| Built: | 2026-05-15 06:16:33 UTC |
| Source: | https://github.com/canmod/iidda-tools |
R wrapper for the IIDDA API.
IIDDA is the International Infectious Disease Data Archive. This archive has an API (Application Programming Interface) for accessing data and potentially for building applications. This R package provides a simple wrapper to this API so that the datasets are returned as data frames.
Useful links for people who just want to get data.
?featured
vignette("Quickstart")
vignette("Provenance")
More advanced users might be interested in the lower-level wrapper
of the API operations here: ?ops.
Maintainer: Steve Walker [email protected]
Useful links:
Access datasets used in the paper describing the Canadian Disease Incidence Dataset (CANDID).
candid_data(dataset_id) candid_lookup(lookup_id) candid_metadata() candid_data_ids() candid_lookup_ids()candid_data(dataset_id) candid_lookup(lookup_id) candid_metadata() candid_data_ids() candid_lookup_ids()
dataset_id |
ID for a particular CANDID dataset. Run
|
lookup_id |
ID for a particular CANDID lookup table. Run
|
candid_data(): Return a data frame of one of the datasets used in the
CANDID paper.
candid_lookup(): Return a data frame of one of the datasets used in the
CANDID paper.
candid_metadata(): Return a list of lists, each of which represents
the metadata for a CANDID dataset.
candid_data_ids(): Return the IDs of all the datasets
used in the CANDID paper.
candid_lookup_ids(): Return the IDs of all the lookup tables
used in the CANDID paper.
Access featured datasets and associated metadata. These datasets required substantial preparation to enhance their utility for research and analysis.
featured_data(dataset_id, ...) featured_metadata() featured_ids()featured_data(dataset_id, ...) featured_metadata() featured_ids()
dataset_id |
ID for a particular featured dataset. Run
|
... |
Character vectors for filtering the data on specific columns, with one vector for each column. See examples below for the syntax for different types of columns. The following list gives instructions for columns that might be available for your dataset. If they are not available you will get a message telling you what columns are in the dataset that you are asking for.
|
featured_data(): Return a data frame of a featured
dataset, possibly filtered.
featured_metadata(): Return a list of lists, each of which represents
the metadata for a featured dataset.
featured_ids(): Return the IDs of all the featured
datasets in the repository.
options(iidda_api_msgs = FALSE) featured_ids() atlantic_polio_1950s = featured_data("canmod-cdi-normalized" , iso_3166_2 = c("CA-NL", "CA-NS", "CA-PE", "CA-NB") , basal_disease = "poliomyelitis" , period_end_date = "1950-01-01..1959-12-31" ) head(atlantic_polio_1950s)options(iidda_api_msgs = FALSE) featured_ids() atlantic_polio_1950s = featured_data("canmod-cdi-normalized" , iso_3166_2 = c("CA-NL", "CA-NS", "CA-PE", "CA-NB") , basal_disease = "poliomyelitis" , period_end_date = "1950-01-01..1959-12-31" ) head(atlantic_polio_1950s)
Links to IIDDA API Interactive Documentation
docs_url docs_url_staging docs_url_localdocs_url docs_url_staging docs_url_local
An object of class character of length 0.
An object of class character of length 1.
An object of class character of length 1.
docs_url: Link to interactive documentation.
docs_url_staging: Link to interactive documentation for a staging
environment.
docs_url_local: Localhost link to interactive documentation for
a development environment, if it exists.
Objects containing the functions associated with API functions
documented here.
These objects are for advanced usage, providing more functionality
than the simpler tools for accessing featured_data.
ops ops_local ops_stagingops ops_local ops_staging
An object of class try-error of length 1.
An object of class try-error of length 1.
An object of class list of length 6.
ops: List containing available operations from the IIDDA API
as R functions
ops_local: Operations list for a local development environment,
if it exists
ops_staging: Operations list for a staging environment, if it exists
## Print out the available functions. names(ops_staging) ## Access functions with a dollar sign. For example, this command ## will give weekly incidence data in January of 1956. options(iidda_api_msgs = FALSE, iidda_api_all_char = TRUE) jan_56 = ops_staging$filter( resource_type = "Communicable Disease Incidence" , dataset_id = "cdi_ca_1956_wk_prov_dbs" , period_end_date = "1956-01-01..1956-02-01" , time_scale = "wk" ) cols = c( "period_end_date" , "location" , "historical_disease" , "cases_this_period" ) print(jan_56[, cols]) ## Operations objects that are not available are error objects. As of the ## time of writing `ops` is not live, but will be. print(class(ops)) ## The `ops_local` is only live for developers who have deployed a ## local version of the API. print(class(ops_local))## Print out the available functions. names(ops_staging) ## Access functions with a dollar sign. For example, this command ## will give weekly incidence data in January of 1956. options(iidda_api_msgs = FALSE, iidda_api_all_char = TRUE) jan_56 = ops_staging$filter( resource_type = "Communicable Disease Incidence" , dataset_id = "cdi_ca_1956_wk_prov_dbs" , period_end_date = "1956-01-01..1956-02-01" , time_scale = "wk" ) cols = c( "period_end_date" , "location" , "historical_disease" , "cases_this_period" ) print(jan_56[, cols]) ## Operations objects that are not available are error objects. As of the ## time of writing `ops` is not live, but will be. print(class(ops)) ## The `ops_local` is only live for developers who have deployed a ## local version of the API. print(class(ops_local))
Get URLs to dependencies of datasets for investigating
data provenance. See vignette("Provenance") for an
illustration. See
iidda-staging
for information on IIDDA identifiers. If you do not have access
to this link, please contact the
maintainer.
url_scans( scan_ids, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) ) url_digitizations( digitization_ids, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) ) url_affected_scripts( digitization_id, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) )url_scans( scan_ids, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) ) url_digitizations( digitization_ids, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) ) url_affected_scripts( digitization_id, dataset_ids = character(), metadata = ops_staging$metadata(dataset_ids = dataset_ids) )
scan_ids |
Character vector of identifiers for scans. |
dataset_ids |
Identifiers for datasets that will restrict the search for dependencies to metadata for these datasets. |
metadata |
List of IIDDA DataCite metadata over a collection of datasets. |
digitization_ids |
Character vector of identifiers for digitizations. |
digitization_id |
Single digitization identifier. |
url_scans(): Convert scan identifiers into URLs that link
to associated scans (typically PDF files).
url_digitizations(): Convert digitization identifiers into URLs that link
to associated digitizations (typically Excel files).
url_affected_scripts(): Returns URLs to all prep scripts that could have
their output modified if the identified digitization were modified.