Advertisement

Getting Started with XML and JSON

  • Deborah Nolan
  • Duncan Temple Lang
Chapter
Part of the Use R! book series (USE R)

Abstract

The goal of this chapter is to provide a rapid introduction to a few high-level functions available to R users for parsing XML and JSON content. In many cases, these functions (read- HTMLTable(), xmlToList(), xmlToDataFrame(), and fromJSON()) are all that you will need to read XML- or JSON- formatted data directly into an R list or dataframe. One of the purposes of this chapter is to introduce many of the functions you need for common applications for scraping data from Web pages, reading data from files, and working with XML and JSON data from Web services. We also want to give you a sense of the possibilities and entice you to learn more about these data formats.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    Civic Impulse, LLC. GovTrack.us developer documentation. http://www.govtrack.us/developers, 2012.
  2. [2]
    Alex Couture-Beil. rjson: Converts R object into JSON and vice-versa. http://cran.rproject.org/web/packages/rjson/, 2011. R package version 0.2.6.
  3. [3]
    JSON Advocate Group. Introducing JSON: A lightweight data-interchange format. http://www.json.org/, 2006.
  4. [4]
    Kiva Organization. Kiva: Loans that change lives. http://www.kiva.org/, 2011.
  5. [5]
    R Development Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria, 2012. http://www.r-project.org.
  6. [6]
    John Simpson. XPath and XPointer: Locating Content in XML Documents. O’Reilly Media, Inc., Sebastopol, CA, 2002.Google Scholar
  7. [7]
    Duncan Temple Lang. RJSONIO: Serialize R objects to JSON (JavaScript Object Notation). http://www.omegahat.org/RJSONIO, 2011. R package version 0.95.
  8. [8]
    Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS. http://www.omegahat.org/RSXML, 2011. R package version 3.4.
  9. [9]
    Wikimedia Foundation. Wikipedia: The free encyclopedia. http://en.wikipedia.org/wiki/Main_Page, 2011.
  10. [10]
    Worldwide Web Consortium. Extensible Markup Language (XML) 1.0. http://www.w3.org/TR/REC-xml/, 2008.

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  • Deborah Nolan
    • 1
  • Duncan Temple Lang
    • 2
  1. 1.Department of StatisticsUniversity of CaliforniaBerkeleyUSA
  2. 2.Department of StatisticsUniversity of CaliforniaDavisUSA

Personalised recommendations