Package 'pactr'

Title: An Interface to the Pandemic PACT Database
Description: The Pandemic PACT <https://www.pandemicpact.org/> monitors and analyses global funding and research evidence related to diseases with pandemic potential, as well as broader research preparedness efforts, and is equipped to pivot in response to outbreaks. It collects, curates, codes, and analyses data in alignment with WHO priority diseases and other selected illnesses, including pandemic influenza, mpox, and plague. Pandemic PACT aims to guide policy and decision-making for research funders, policymakers, researchers, multilateral agencies. The database is publicly available for download from its website and from Figshare. This package interfaces with the project's Figshare repository to provide programmatic access to the database along with other data products provided by the project.
Authors: Ernest Guevarra [aut, cre]
Maintainer: Ernest Guevarra <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9000
Built: 2025-02-12 05:42:26 UTC
Source: https://github.com/OxfordIHTM/pactr

Help Index


Cite an output/asset available from the Pandemic PACT Figshare repository

Description

Cite an output/asset available from the Pandemic PACT Figshare repository

Usage

pact_cite(pact_client, id)

Arguments

pact_client

An interface client to the Pandemic PACT Figshare repository. This is usually set/created through a call to pact_client_set().

id

A unique integer value identifying a specific file in the repository.

Value

A string for recommended bibliographic citation for specific Pandemic PACT output/asset in DateCite bibliographic style.

Examples

## Not run: 
  pact_client <- pact_client_set()
  pact_cite(pact_client, id = 24763548)

## End(Not run)

Initiate a new Pandemic PACT Figshare client session

Description

Initiate a new Pandemic PACT Figshare client session

Usage

pact_client_set()

Value

A local client to the Figshare service.

Examples

## Not run: 
  pact_client_set()

## End(Not run)

Download outputs/assets from Pandemic PACT Figshare repository

Description

Download outputs/assets from Pandemic PACT Figshare repository

Usage

pact_download_figshare(pact_client, id, path, overwrite = FALSE, quiet = TRUE)

pact_download_figshare_private(path, overwrite = FALSE, quiet = TRUE)

pact_download_website(path, overwrite = FALSE, quiet = TRUE)

Arguments

pact_client

An interface client to the Pandemic PACT Figshare repository. This is usually set/created through a call to pact_client_set().

id

A unique integer value identifying a specific file in the repository.

path

The local directory where file is to be downloaded.

overwrite

Logical. Should existing files be overwritten? If TRUE, existing files will be overwritten. Default is FALSE.

quiet

Logical. If TRUE (default), download progress is not displayed.

Value

The full path of the downloaded file.

Examples

## Not run: 
  ## From Figshare
  pact_client <- pact_client_set()
  pact_download_figshare(pact_client, id = 25827649, path = tempdir())

  ## From website
  pact_download_website(path = tempdir())

## End(Not run)

Get outputs/assets identifiers

Description

Get outputs/assets identifiers

Usage

pact_get_group_id(pact_client)

pact_get_filename(pact_client, id)

Arguments

pact_client

An interface client to the Pandemic PACT Figshare repository. This is usually set/created through a call to pact_client_set().

id

A unique integer value identifying a specific file in the repository.

Value

An integer or character value or vector of values for requested identifier.

Examples

## Not run: 
  pact_client <- pact_client_set()
  pact_get_group_id(pact_client)
  pact_get_filename(pact_client, id = 24763548)

## End(Not run)

List all available outputs/assets from Pandemic PACT's Figshare repository

Description

List all available outputs/assets from Pandemic PACT's Figshare repository

Usage

pact_list(pact_client)

pact_list_data(pact_client)

pact_list_download(path_to_download)

Arguments

pact_client

An interface client to the Pandemic PACT Figshare repository. This is usually set/created through a call to pact_client_set().

path_to_download

Path to downloaded zip file from Pandemic PACT's Figshare repository

Value

A data.frame of available outputs/assets from Pandemic PACT's Figshare repository.

Examples

## Not run: 
  pact_list(pact_client = pact_client_set())

## End(Not run)

Pandemic PACT Mpox Priorities

Description

Pandemic PACT Mpox Priorities

Usage

pact_mpox_priority

Format

A data.frame with 4 columns and 23 rows:

Variable Description
mpox_priority_code Two digit Mpox priority code
mpox_priority Mpox priority name
mpox_subpriority_code Four digit Mpox sub-priority code
mpox_subpriority Mpox sub-priority name

Source

Pandemic PACT website https://www.pandemicpact.org/

Examples

pact_mpox_priority

Process Pandemic PACT data

Description

Process Pandemic PACT data

Usage

pact_process_figshare(df)

pact_process_figshare_category(df, category, other = NULL, nest = FALSE)

pact_process_figshare_category_pathogen(df)

pact_process_figshare_category_funder(df)

Arguments

df

A data.frame of the Pandemic PACT dataset from the Figshare repository or from the website.

category

A character value for the variable category to look for in the fields for df for collapsing multiple fields into one.

other

A character value for the name of the variable in df for values for other for fields that have an other option. Default to NULL to indicate that field category has no other option.

nest

Logical. Should variable/fields with multiple values be nested? Default to FALSE.

Value

A tibble of processed Pandemic PACT dataset.

Examples

## Not run: 
  pact_data <- pact_read_figshare(pact_client_set())
  pact_process_figshare(df = pact_data)

## End(Not run)

Process Pandemic PACT dataset retrieved from the website

Description

Process Pandemic PACT dataset retrieved from the website

Usage

pact_process_website(pact_data, col_list = TRUE, fix = TRUE)

Arguments

pact_data

A data.frame for the Pandemic PACT dataset read from the Pandemic PACT website. This is usually obtained via a call to pact_read_website().

col_list

Logical. Should variable/fields with multiple values be made into column lists? Default to TRUE.

fix

Logical. Should fixes be applied to the dataset based on known issues? Default to TRUE.

Value

A tibble of the dataset from the website structured based on col_list and 'fix“ specifications.

Examples

## Not run: 
  pact_data <- pact_read_website()
  pact_process_website(pact_data)

## End(Not run)

Read datasets from the Pandemic PACT Figshare repository

Description

Read datasets from the Pandemic PACT Figshare repository

Usage

pact_read_figshare(pact_client, tracker_type = c("labelled", "raw"))

pact_read_figshare_dictionary(pact_client)

pact_read_figshare_download(path_to_download, filename)

Arguments

pact_client

An interface client to the Pandemic PACT Figshare repository. This is usually set/created through a call to pact_client_set().

tracker_type

Either "labelled" or "raw". Default is "labelled".

path_to_download

Path to downloaded private Figshare collection zip file.

filename

Filename of Pandemic PACT asset or dataset to read from downloaded private Figshare collection zip file.

Value

A data.frame of the requested dataset.

Examples

## Not run: 
  pact_client <- pact_client_set()
  pact_read_figshare_dictionary(pact_client)

## End(Not run)

Read datasets from the Pandemic PACT website

Description

Read datasets from the Pandemic PACT website

Usage

pact_read_website(.url = NULL)

Arguments

.url

The URL for the website dataset.

Value

A tibble of the Pandemic PACT dataset from the website.

Examples

## Not run: 
  pact_read_website()

## End(Not run)

Pandemic PACT Research Categories

Description

Pandemic PACT Research Categories

Usage

pact_research_category

Format

A data.frame with 4 columns and 70 rows:

Variable Description
research_category_code Two digit research category code
research_category Research category name
research_subcategory_code Four digit research sub-category code
research_subcategory Research sub-category name

Source

Pandemic PACT website https://www.pandemicpact.org/

Examples

pact_research_category

Process variable of interest from Pandemic PACT website data by a grouping variable

Description

Process variable of interest from Pandemic PACT website data by a grouping variable

Usage

pact_table_topic_group(
  pact_data_list_cols,
  topic,
  group = NULL,
  na_values = NULL
)

pact_table_disease(pact_data_list_cols, group = NULL, na_values = NULL)

pact_table_category(
  pact_data_list_cols,
  topic = c("ResearchCat", "ResearchSubcat"),
  na_values = NULL
)

pact_table_location_funder(
  pact_data_list_cols,
  topic = c("FunderRegion", "FunderCountry"),
  na_values = NULL
)

pact_table_location_institution(
  pact_data_list_cols,
  topic = c("ResearchInstitutionRegion", "ResearchInstitutionCountry"),
  na_values = NULL
)

pact_table_location_research(
  pact_data_list_cols,
  topic = c("ResearchLocationRegion", "ResearchLocationCountry"),
  na_values = NULL
)

Arguments

pact_data_list_cols

A data.frame for the Pandemic PACT dataset read from the Pandemic PACT website that has already been pre-processed to have list columns for nested variables. This is usually obtained via a call to pact_process_website() with col_list = TRUE.

topic

A character value of the variable name in pact_data for the topic of interest.

group

A character value or vector of up to two values of the variable name/s in pact_data_list_cols to use as grouping variable/s. When specified as NULL (default), no grouping is applied to the tabulation based on the topic of interest and group specified.

na_values

A character value or vector of values for strings to be considered as NA for topic and group. If NULL (default), topic and group are kept as is.

Value

A data.frame structured based on specification. If group is NULL, the data.frame presents values for topic as first column and then either frequencies/counts of grants per topic value or sum of monetary amount of grants per topic. if group has one value, the data.frame presents values for group as first column followed by either frequencies/counts of grants per group or sum of monetary amount of grants per group then followed by the topics within each group followed by either frequencies/counts of grants per topic by group or sum of monetary amount of grants per topic by group.

Examples

## Not run: 
  df <- pact_read_website() |> pact_process_website()
  pact_table_topic_group(df, topic = "Disease")

## End(Not run)

World Health Organization (WHO) Country Information

Description

World Health Organization (WHO) Country Information

Usage

who_country_info

Format

A data.frame with 5 columns and 194 rows:

Variable Description
country_iso3c ISO-3 country code
who_short_name Country short name given by WHO
formal_name Country formal name
who_region WHO region name to which country belongs to
un_region UN region name to which country belongs to

Source

Data are drawn from WHO's Data Country list found at https://data.who.int/countries/

Examples

who_country_info