append_survey: Function to add time invariant and demographic data to WRAP...

View source: R/read_WRAP.R

append_surveyR Documentation

Function to add time invariant and demographic data to WRAP data

Description

Function to add time invariant and demographic data to WRAP data

Usage

append_survey(vars, wrap, survey)

Arguments

wrap

WRAP data produced by 'read_wraps' (e.g., sleep, activity, or stress)

survey

A data frame in wide format with the first column containing the ID variable and the remaining columns with survey data with names in the format 'varName_#' where '#' are integers that overlap with the range of values in the WRAP data variable 'time_days', eg. 'range(sleep$time_days)'.

what

Whether the 'all' of the WRAP data appended with the survey data should be returned, or only the 'new' data should be returned (i.e., the survey data in long format with variable names required for merging with the WRAP data). The function 'append_dailies' loops through a list of survey variables and uses the 'new' option to reduce memory use.


ICTatRTI/PersonAlytics documentation built on Dec. 13, 2024, 11:06 p.m.