spu.indicator.data: Reformat SPU data as a data frame

View source: R/extract-spu.R

spu.indicator.dataR Documentation

Reformat SPU data as a data frame

Description

Return a data frame of HIV incidence and prevalence estimates. Uncertainty data in SPU files are sampled from some distribution. Sampling may be done with replacement. Formatted SPU data include a sample id column ("Sample"), the sampling frequency ("Frequency"), and Year. If "wide" output is requested, the dataframe will have columns for HIV prevalence and incidence; if "long" output is requested, the dataframe will have an Indicator and Value columns instead. The SPU data includes the best-fitting incidence and prevalence point estimate. This has sample ID 0 and missing (NA) sampling frequency.

Usage

spu.indicator.data(raw.spu, direction = "wide")

Arguments

raw.spu

SPU data returned by read.raw.spu

Value

a dataframe in long or wide format

Examples

spu = read.raw.spu("Antarctica.PJNZ")
dat = spu.indicator.data(spu, direction="long")

rlglaubius/SpectrumUtils documentation built on Dec. 20, 2024, 7:31 a.m.