XML2R | R Documentation |
This function is an experimental wrapper around XML2Obs. One should only use this function over XML2Obs if keys already exist in the XML data and ancestory doesn't need to be altered.
XML2R(urls, xpath, df = FALSE)
urls |
character vector or list of urls that point to an XML file (or anything readable by xmlParse). |
xpath |
XML XPath expression that is passed to getNodeSet. If missing, the entire root and all descendents are captured and returned (ie, tables = "/"). |
df |
logical. Should matrices be coerced into data frames? |
Returns list with one element for each relevant XML node. Each element contains a matrix by default.
urlsToDocs, docsToNodes, nodesToList, listsToObs
## Not run:
urls2 <- c("http://gd2.mlb.com/components/game/mlb/year_2013/mobile/346180.xml",
"http://gd2.mlb.com/components/game/mlb/year_2013/mobile/346188.xml")
dat3 <- XML2R(urls2)
cens <- "http://www.census.gov/developers/data/sf1.xml"
census <- XML2R(cens)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.