readHIVData: Reads the standard HIV .dta file into R.

View source: R/getHIV.R

readHIVDataR Documentation

Reads the standard HIV .dta file into R.

Description

Reads in AHRI data from standard HIV .dta file

Usage

readHIVData(
  inFile = NULL,
  dropTasP = TRUE,
  addVars = " ",
  drop15Less = TRUE,
  write_rda = TRUE
)

Arguments

inFile

File path to .dta, default is set by setFiles.

dropTasP

Default is to drop TasP surveillance areas from the data.

addVars

A regular expression string representing the variables to be added.

drop15Less

Default is to drop all observations with Age < 15 years. Only participants >=15 years eligible for HIV testing.

write_rda

Default is to write the .Rda file.

Value

data.frame

Examples

# Writes .Rda to file

readHIVData(write_rda = TRUE)

# Drop TasP areas, dont write to file
readHIVData(dropTasP = FALSE, write_rda = TRUE)
# Saves to global environment 
hdat <- readHIVData(write_rda=FALSE)
# Add variables
hdat <- readHIVData(addVars="HIVRefused|WhereLastTested", write_rda=FALSE)

vando026/ahri documentation built on Aug. 10, 2024, 3:20 p.m.