Package 'specio'

Title: Read Spectrum Files
Description: Read data from Spectrum PJNZ file into R consumable format for EPP.
Authors: Robert Ashton [aut, cre]
Maintainer: Robert Ashton <[email protected]>
License: GPL-3
Version: 0.1.4
Built: 2024-10-24 02:58:15 UTC
Source: https://github.com/mrc-ide/specio

Help Index


Extract ART population data from PJNZ file

Description

Get ART population data separated by year, sex and age. Final age is open ended age group 80+.

Usage

read_art_pop(pjnz_path, long_format = FALSE)

Arguments

pjnz_path

Path to PJNZ file to extract the data from.

long_format

If TRUE then data is returned in long format.

Value

3D array of ART population data separated by year, sex and age.

Examples

pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio")
art_population <- read_art_pop(pjnz_path)
art_pop_long <- read_art_pop(pjnz_path, TRUE)

Read EPP fitting surveillance data

Description

Reads the HIV prevalence from sentinel surveillance and household surveillance data from the EPP .xml file within a PJNZ.

Usage

read_epp_data(pjnz_path)

Arguments

pjnz_path

Path to Spectrum PJNZ file.

Details

EPP projection sets are identified in the .xml file by searching the XML tree for tag "object", and then selecting objects with "class" attribute equal to "epp2011.core.sets.ProjectionSet".

Value

List of data frames containing prevalence and incidence data.

Examples

pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio")
read_epp_data(pjnz_path)

Read EPP subpopulation configuration.

Description

Reads the subpopulation configuration and population sizes from the EPP .xml file within a PJNZ.

Usage

read_epp_subpops(pjnz_path)

Arguments

pjnz_path

file path to Spectrum PJNZ file.

Details

EPP projection sets are identified in the .xml file by searching the XML tree for tag "object", and then selecting objects with "class" attribute equal to "epp2011.core.sets.ProjectionSet".


Extract people living with HIV (PLHIV) from PJNZ file

Description

Get HIV population data separated by year, sex and age. Final age is open ended age group 80+.

Usage

read_hiv_pop(pjnz_path, long_format = FALSE)

Arguments

pjnz_path

Path to PJNZ file to extract the data from.

long_format

If TRUE then data is returned in long format.

Value

3D array of HIV population data separated by year, sex and age.

Examples

pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio")
hiv_population <- read_hiv_pop(pjnz_path)
hiv_pop_long <- read_hiv_pop(pjnz_path, TRUE)

Read params from DP and PJN file required for HIV model.

Description

Read params from DP and PJN file required for HIV model.

Usage

read_hivproj_param(pjnz_path)

Arguments

pjnz_path

Path to PJNZ zip file containing DP file and PJN file.

Value

List of model params.

Examples

pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio")
read_hivproj_param(pjnz_path)

Get country name, iso3 code and spectrum region code from PJNZ

Description

Get country name, iso3 code and spectrum region code from PJNZ

Usage

read_pjn_metadata(pjnz)

Arguments

pjnz

Path to PJNZ file.

Value

The country and region code metadata


Read best fitting HIV incidence and prevalence data from SPT file.

Description

Locates SPT file within the PJNZ file and reads out the best fitting incidence and prevalence data into memory.

Usage

read_spt(pjnz_path)

Arguments

pjnz_path

Path to the PJNZ file.

Details

Reads best fitting prevalence and incidence and population data for all regions. The outputs one data frame for each region in the SPT file.

Value

List of data frames containing the best fit prevalence and incidence data.

Examples

pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio")
read_spt(pjnz_path)

Read EPP uncertainty results from SPU file.

Description

Read EPP uncertainty results from SPU file.

Usage

read_spu(pjnz_path)

Arguments

pjnz_path

Path to the PJNZ file.

Value

List containing uncertainty results for prevalence and incidence


Extract population data from PJNZ file

Description

Get population data separated by year, sex and age. Final age is open ended age group 80+.

Usage

read_total_pop(pjnz_path, long_format = FALSE)

Arguments

pjnz_path

Path to PJNZ file to extract the data from.

long_format

If TRUE then data is returned in long format.

Value

3D array of population data separated by year, sex and age.

Examples

pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio")
population <- read_total_pop(pjnz_path)
pop_long <- read_total_pop(pjnz_path, TRUE)