listsToObs: Flatten nested list into a list of observations

Description Usage Arguments Value

View source: R/utils.R

Description

This function flattens the nested list into a list of "observations" (that is, a list of matrices with one row). The names of the list that is returned reflects the XML ancestory of each observation.

Usage

1
listsToObs(l, urls, append.value = TRUE, as.equiv = TRUE, url.map = TRUE)

Arguments

l

list. Should be the output from nodesToList.

urls

character vector the same length as l. Each element should map element of l to an XML file.

append.value

logical. Should the XML value be appended to the observation?

as.equiv

logical. Should observations from two different files (but the same ancestory) have the same name returned?

url.map

logical. If TRUE, the 'url_key' column will contain a condensed url identifier (for each observation) and full urls will be stored in the "url_map" element. If FALSE, the full urls are included (for each observation) as a 'url' column and no "url_map" is included.

Value

A list where each element reflects one "observation".


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