add_key: Add a key to connect parents to descendants

Description Usage Arguments Value

View source: R/utils.R

Description

This function creates a mapping from parent observations to it's descendants (which useful for merging/joining tables). Either an existing value in the parent observation can be recycled to it's descendants or a new column will be created (if recycle is missing).

Usage

1
add_key(obs, parent, recycle, key.name, quiet = FALSE)

Arguments

obs

list. Should be the output from listsToObs.

parent

character string. Should be present in the names of obs.

recycle

character string that matches a variable name among parent observations.

key.name

The desired column name of the newly generated key.

quiet

logical. Include message about the keys being generated?

Value

A list of observations.


cpsievert/XML2R documentation built on May 13, 2019, 10:54 p.m.