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-12-23 02:58:55 UTC |
Source: | https://github.com/mrc-ide/specio |
Get ART population data separated by year, sex and age. Final age is open ended age group 80+.
read_art_pop(pjnz_path, long_format = FALSE)
read_art_pop(pjnz_path, long_format = FALSE)
pjnz_path |
Path to PJNZ file to extract the data from. |
long_format |
If TRUE then data is returned in long format. |
3D array of ART population data separated by year, sex and age.
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)
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)
Reads the HIV prevalence from sentinel surveillance and household surveillance data from the EPP .xml file within a PJNZ.
read_epp_data(pjnz_path)
read_epp_data(pjnz_path)
pjnz_path |
Path to Spectrum PJNZ file. |
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".
List of data frames containing prevalence and incidence data.
pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio") read_epp_data(pjnz_path)
pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio") read_epp_data(pjnz_path)
Reads the subpopulation configuration and population sizes from the EPP .xml file within a PJNZ.
read_epp_subpops(pjnz_path)
read_epp_subpops(pjnz_path)
pjnz_path |
file path to Spectrum PJNZ file. |
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".
Get HIV population data separated by year, sex and age. Final age is open ended age group 80+.
read_hiv_pop(pjnz_path, long_format = FALSE)
read_hiv_pop(pjnz_path, long_format = FALSE)
pjnz_path |
Path to PJNZ file to extract the data from. |
long_format |
If TRUE then data is returned in long format. |
3D array of HIV population data separated by year, sex and age.
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)
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.
read_hivproj_param(pjnz_path)
read_hivproj_param(pjnz_path)
pjnz_path |
Path to PJNZ zip file containing DP file and PJN file. |
List of model params.
pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio") read_hivproj_param(pjnz_path)
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
read_pjn_metadata(pjnz)
read_pjn_metadata(pjnz)
pjnz |
Path to PJNZ file. |
The country and region code metadata
Locates SPT file within the PJNZ file and reads out the best fitting incidence and prevalence data into memory.
read_spt(pjnz_path)
read_spt(pjnz_path)
pjnz_path |
Path to the PJNZ file. |
Reads best fitting prevalence and incidence and population data for all regions. The outputs one data frame for each region in the SPT file.
List of data frames containing the best fit prevalence and incidence data.
pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio") read_spt(pjnz_path)
pjnz_path <- system.file("testdata", "Botswana2018.PJNZ", package = "specio") read_spt(pjnz_path)
Read EPP uncertainty results from SPU file.
read_spu(pjnz_path)
read_spu(pjnz_path)
pjnz_path |
Path to the PJNZ file. |
List containing uncertainty results for prevalence and incidence
Get population data separated by year, sex and age. Final age is open ended age group 80+.
read_total_pop(pjnz_path, long_format = FALSE)
read_total_pop(pjnz_path, long_format = FALSE)
pjnz_path |
Path to PJNZ file to extract the data from. |
long_format |
If TRUE then data is returned in long format. |
3D array of population data separated by year, sex and age.
pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio") population <- read_total_pop(pjnz_path) pop_long <- read_total_pop(pjnz_path, TRUE)
pjnz_path <- system.file("testdata", "Botswana2017.PJNZ", package = "specio") population <- read_total_pop(pjnz_path) pop_long <- read_total_pop(pjnz_path, TRUE)