From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Working with XML data
From the course: Complete Guide to R: Wrangling, Visualizing, and Modeling Data
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 principle supply for 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 salestax rate by county. And to do this, we're first going to save the URL for the dataset that we want. This is the URL for the whole thing. I'm going to save…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Creating tidy data10m 12s
-
(Locked)
Using tibbles4m 51s
-
(Locked)
Using data.table4m 57s
-
(Locked)
Converting data from wide to tall and from tall to wide4m 13s
-
(Locked)
Converting data from tables to rows5m 2s
-
(Locked)
Working with dates and times6m 21s
-
Working with list data5m 14s
-
(Locked)
Working with XML data5m 22s
-
(Locked)
Working with categorical variables6m 29s
-
(Locked)
Filtering cases and subgroups7m 32s
-
(Locked)
-
-
-
-
-
-
-