Skip to contents

Load an individual PicnicHealth table and optionally specify data type conversions.

Usage

load_table(path, dict = NULL)

Arguments

path

A directory path to a PicnicHealth data set csv file, including the table name and the .csv file extension.

dict

A PicnicHealth dictionary stored as a data frame including field and data_type columns. The default is NULL.

Value

A data tibble.

Details

If specifying a PicnicHealth data dictionary data frame, i.e. dict, for data type conversions, dict should be read in as a data.frame object.

See also

  • load_data_set() to load an entire directory of PicnicHealth data set tables as CSV files.

  • filter_data_set() to filter a data set using a specified list of patients.

Examples

if (FALSE) { # \dontrun{
# In the current working directory:
drug <- load_table("drug.csv")

# Full path:
person <- load_table("/path/to/data/person.csv")

# Read in a PicnicHealth data dictionary file and the corresponding table:
dict_person <- read.csv("./data_dictionary/clinical/person.csv")
person <- load_table("./data/clinical/person.csv", dict = dict_person)
} # }