Provides easier interaction with Socrata open data portals http://dev.socrata.com. Users can provide a 'Socrata' data set resource URL, or a 'Socrata' Open Data API (SoDA) web query, or a 'Socrata' "human-friendly" URL, returns an R data frame. Converts dates to 'POSIX' format. Manages throttling by 'Socrata'.
Given the URL:
url <- "https://data.cityofnewyork.us/resource/qiz3-axqb.json?&$select=crash_date%20as%20date,%20borough,%20zip_code,%20latitude,%20longitude&$where=zip_code%20like%20'%2510040%25'"
If pasted into the address bar of a browser or pulled directly via the following:
Given the URL:
url <- "https://data.cityofnewyork.us/resource/qiz3-axqb.json?&$select=crash_date%20as%20date,%20borough,%20zip_code,%20latitude,%20longitude&$where=zip_code%20like%20'%2510040%25'"
If pasted into the address bar of a browser or pulled directly via the following:
df <- jsonlite::fromJSON(url)
the request works. However, if I try:
RSocrata::read.socrata(url, app_token = MYAPPTOKEN)
I get:
Error: All components of query must be named
The issue: my url doesn't have a
query
parameter - it is a SELECT with a WHERE clause - butread.socrata
thows aquery
error.