View source: R/read-spectrum.R
dp_read_anc_testing | R Documentation |
Read Spectrum programme data inputs
dp_read_anc_testing(dp)
dp_read_pmtct(dp)
dp_read_pmtct_retained(dp)
dp_read_abortion(dp)
dp_read_breastfeeding(dp)
dp_read_childart(dp)
dp_read_childltfu(dp)
dp_read_viral_suppression(dp)
dp |
An '"spectrum_dp"' object created by 'read_dp()' or a path to a Spectrum PJNZ file. |
These functions accepts either a path to a PJNZ file or an already parsed '.DP' file read using ['read_dp()'] with class '"spectrum_dp"'. Unzipping and reading the '.DP' file is the slow part of the function, so if reading lots of data from the same file, it will be most efficient to read it once and pass that to the functions.
Most functions return a matrix in which rows are each indicator and columns are years
'dp_read_abortion()' returns a list in which the vector 'pregtermabortion' is the numerical values and 'pregtermabortion_isperc' is a logical indicating whether each value corresponds to a number (count) input or percentage input.
pjnz <- system.file("pjnz/bwa2021_v6.13.pjnz", package = "leapfrog")
dp <- read_dp(pjnz)
dp_anc_testing <- dp_read_anc_testing(dp)
dp_pmtct <- dp_read_pmtct(dp)
dp_pmtct_ret <- dp_read_pmtct_retained(dp)
dp_abortion <- dp_read_abortion(dp)
dp_notbreastfeeding <- dp_read_breastfeeding(dp)
dp_childart <- dp_read_childart(dp)
dp_childltfu <- dp_read_childltfu(dp)
dp_vls <- dp_read_viral_suppression(dp)
## Can either pass PJNZ path or parsed "spectrum_dp" object
anc_testing1 <- dp_read_anc_testing(pjnz)
anc_testing2 <- dp_read_anc_testing(dp)
all.equal(anc_testing1, anc_testing2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.