listsToObs function

Flatten nested list into a list of observations

Flatten nested list into a list of observations

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.

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.

Returns

A list where each element reflects one "observation".

  • Maintainer: Carson Sievert
  • License: GPL (>= 2)
  • Last published: 2024-06-04