read_ndr: Import NDR Line-lists into R

View source: R/read_ndr.R

read_ndrR Documentation

Import NDR Line-lists into R

Description

Import the basic NDR patient-level line lists (treatment, recent infection, and HTS) into R. Column names and types are appropriately formatted using the type argument.

Usage

read_ndr(path, type = "treatment", ...)

Arguments

path

Path to the csv file on your computer. The file path should be specified in the format "C:/users/Desktop/your file.csv" or something similar.

type

type of line list to be imported. Currently, the read_ndr() supports any of treatment, recency or hts line-lists.

...

passes other arguments supplied based on the specific NDR line-list to be read. NDR treatment line-list requires the time_stamp argument for the day of reference of the treatment line-list, and an optional quiet argument (which defaults to FALSE) denoting if R should also print the message about the new columns created. An optional cols can also be used to supply specific column type to allow the user control over the variable types should the default satisfy the user need.

Value

nicely formatted line-list

Examples

# Read \code{ndr_example.csv} from a path

file_path <- system.file("extdata", "ndr_example.csv", package = "tidyndr")
read_ndr(file_path, time_stamp = "2021-02-15")

# Read using a link to the NDR csv file on the internet

file_path <- "https://raw.githubusercontent.com/stephenbalogun/example_files/main/ndr_example.csv"
read_ndr(file_path, time_stamp = "2021-02-15")


tidyndr documentation built on April 8, 2022, 9:06 a.m.