add.data: Augment Data Variables

Description Usage Arguments Details Value Examples

View source: R/load-data.R View source: R/load-data copy.R

Description

This function serves to add variables to the master tibble dataframe. Variables are joined in on the id column.

Usage

1
add.data(new.path, old.data, scaled = F, mods, filts = NULL)

Arguments

new.path

Path to Stata .dta file containing new variables

old.data

Tibble of old study data to merge with

scaled

Boolean indicating whether new data should be scaled

mods

List of paths to formatted csv files creating new adjustment variables. Format of csv is detailed below. This parameter is required. See get.adjust() for formatting.

filts

List of path (singular) to formatted csv of the data filters to be applied to the dataset. See get.adjust() for formatting.

Details

See get.adjust() for csv formatting details.

Value

Tibble with new variables joined in.

Examples

1
2
3
4
5
6
## Not run: 
fifth.visit.adtl <- add.data(new.path = 'data/ARIC_proteomics_addlvar_01062021.dta',
                             old.data = haven::read_dta('data/ARICmaster_121820.dta'),
                             mods = list('data/visit-five/adtlvars.csv'))

## End(Not run)

pranavdorbala/proteomicsHF documentation built on March 9, 2021, 12:22 a.m.