Getting Started with XML and JSON

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


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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    Civic Impulse, LLC. developer documentation., 2012.
  2. [2]
    Alex Couture-Beil. rjson: Converts R object into JSON and vice-versa., 2011. R package version 0.2.6.
  3. [3]
    JSON Advocate Group. Introducing JSON: A lightweight data-interchange format., 2006.
  4. [4]
    Kiva Organization. Kiva: Loans that change lives., 2011.
  5. [5]
    R Development Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria, 2012.
  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)., 2011. R package version 0.95.
  8. [8]
    Duncan Temple Lang. XML: Tools for parsing and generating XML within R and S-PLUS., 2011. R package version 3.4.
  9. [9]
    Wikimedia Foundation. Wikipedia: The free encyclopedia., 2011.
  10. [10]
    Worldwide Web Consortium. Extensible Markup Language (XML) 1.0., 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