load_labs_merge: Create data dictionary

Description Usage Arguments Value Examples

View source: R/create_datasets.R

Description

Creates a simple data dictionary based on variable labels for each NHANES file

Usage

1
load_labs_merge(vec_of_files = NULL, yr, data_dir = "./data")

Arguments

vec_of_files

The character vector of files to be retrieved. The "demo" file is ALWAYS included, and should NOT be specified.

yr

The year for which the file should be extracted.

data_dir

The directory in which all of your NHANES subdirectories (one for each year) reside. Default is the project "data" subdirectory (i.e., "./data") but if your data are elsewhere, you must specify the directory. Keep in mind that this will be a directory that contains all of your NHANES subdirectories. It is NOT the subdirectory for a specific year. Do not use a slash (/) at the end.

Value

Returns a dataframe (a data.table) of all of the labels from each file in the character vector, including "demo".

Examples

1
2
3
4
5
## Not run: 
# Load label files listed in character vector
full_labels <- load_labs_merge(listing, 2003)

## End(Not run)

outcomesinsights/nhanes.tools documentation built on May 24, 2019, 5:54 p.m.