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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Civic Impulse, LLC. GovTrack.us developer documentation. http://www.govtrack.us/developers, 2012.
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.
JSON Advocate Group. Introducing JSON: A lightweight data-interchange format. http://www.json.org/, 2006.
Kiva Organization. Kiva: Loans that change lives. http://www.kiva.org/, 2011.
R Development Core Team. R: A Language and Environment for Statistical Computing. Vienna, Austria, 2012. http://www.r-project.org.
John Simpson. XPath and XPointer: Locating Content in XML Documents. O’Reilly Media, Inc., Sebastopol, CA, 2002.
Duncan Temple Lang. RJSONIO: Serialize R objects to JSON (JavaScript Object Notation). http://www.omegahat.org/RJSONIO, 2011. R package version 0.95.
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.
Wikimedia Foundation. Wikipedia: The free encyclopedia. http://en.wikipedia.org/wiki/Main_Page, 2011.
Worldwide Web Consortium. Extensible Markup Language (XML) 1.0. http://www.w3.org/TR/REC-xml/, 2008.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer Science+Business Media New York
About this chapter
Cite this chapter
Nolan, D., Lang, D.T. (2014). Getting Started with XML and JSON . In: XML and Web Technologies for Data Sciences with R. Use R!. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-7900-0_1
Download citation
DOI: https://doi.org/10.1007/978-1-4614-7900-0_1
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-7899-7
Online ISBN: 978-1-4614-7900-0
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)