How to import data from .json file into R?



I am fairly new to R, but the more use it, the more I see how powerful it really is over SAS or SPSS. Just one of the major benefits, as I see them, is the ability to get and analyze data from the web.I imagine this will be straight forward in R,currently I am currently want to know is there is a way by which I can read the data of .json format in R.


Hi @harry,

This is a link to a json file:json file

The library jsonlite in R can be used to import the data:

hadley <- fromJSON("")

This should give the following dataframe:

Hope this helps!!


if you read from a file with json then you could use
tipdata<-fromJSON(sprintf("[%s]", paste(readLines(filename), collapse=",")))
This will give you the data frame tipdata in this case.