From the course: R Essential Training: Wrangling and Visualizing Data

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with XML data

Working with XML data

From the course: R Essential Training: Wrangling and Visualizing Data

Start my 1-month free trial

Working with XML data

- [Instructor] We've seen elsewhere, how to import hierarchically structured data in XML or JSON format into R. I want to run through a slightly more extended example. I'm just going to be using XML. The same general principles apply if we're using JSON data, of course, you'll be using a different package and you may have to specify. But let's see how we can do this in R with an online dataset that comes in XML. So let's start by loading a few packages. The important one on this one is xml2, it's a package for working with XML data. By the way, XML stands for Extensible Markup Language and it's a very common format for data that's stored on the web. We're going to be using some data that comes from the Missouri data portal and we're going to get a little bit of financial information, specifically, we're going to be looking for the sales tax rate by county. And to do this, we're first going to save the URL for the…

Contents