I am trying to import JSON data from a URL and save it as a dataframe. Once I have it in a single rows/columns format dataframe, I want to perform cleaning operations like removing some values and columns.
I am using jsonlite package to automatically parse the data and save in dataframe format. However, it seems to create a list of dataframes instead of one dataframe.
#install
install.packages("jsonlite")
#load
library(jsonlite)
#fetch JSON data
litejson <- "https://data.maryland.gov/api/views/pdvh-tf2u/rows.json?accessType=DOWNLOAD"
myjson <- fromJSON(litejson)
print(myjson)
# It seems the jsonlite didn't parse the data properly. It is a list of data frames instead of one single data frame.
str(myjson)
#WHAT AM I DOING WRONG?