From the course: R Programming in Data Science: High Variety Data

Unlock the full course today

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

JSON in R

JSON in R

From the course: R Programming in Data Science: High Variety Data

Start my 1-month free trial

JSON in R

- [Instructor] JSON or JavaScript Object Notation, is a popular web notation that has also been used for a lot of different data types. In particular, geographic information. R has a lot of packages to handle JSON, df2JSON, goJSON, there are others, but in this case we're going to use JSON Light. And the first thing you'll need to do is install that package if you haven't already, use the install packages JSON Light and then the library command to make sure that it's available for use. To import a JSON file, use the read under bar JSON command. It looks like this where I type in a vector that I'm going to import it into and I say read, under bar, J-S-O-N. Notice that the dot and the under bar are important. Then I'm going to specify a JSON file to import. I have one in the sample files directory and it's called J-S-O-N data dot J-S-O-N. Now if I just import it like this I'll receive a list. Instead, I want to receive a data frame and to do that I type in simplifyVector and I'll set…

Contents