merge_lists: Merge a list of lists into one list

Description Usage Arguments Value Examples

View source: R/experiments.R

Description

merges list of lists specifying source and variables from each source into one list

Usage

1
merge_lists(list_of_lists)

Arguments

list_of_lists

list of lists, each with structure list(source1 = c(var1, var2), source2 = c(var3, var4)) where source is a source of data as defined in a Person object, and var1 and var2 are variables from source1, while var3 and var4 are variables from source2

Value

one list, with structure list(source1 = c(var1, var2), source2 = c(var3, var4)), where variables from the same source have been grouped in that source's sublist

Examples

1
2
3
4
5
variables = list("fitbit_intraday" = c("steps"), 
                "fitbit_daily" = c("sleepDuration"),
                "util" = c("day_of_week", "day_type", "month"))
measures = list("fitbit_daily" = c("distance", "restingHeartRate"))
all_variables <- merge_lists(list(variables, measures))

lifelogr documentation built on May 2, 2019, 6:11 a.m.