ropensci / nomisr

Access UK official statistics from the Nomis database through R.
https://docs.ropensci.org/nomisr
Other
46 stars 12 forks source link

replaced redundant call to read_csv with httr::content #19

Closed Chrisjb closed 4 years ago

Chrisjb commented 4 years ago

I noticed that in utils-get-data.R we call httr::GET() which gets the data as a response. This step just seems to be to check there are no errors. Later on the data is read in with readr::read_csv(api_get$url) which then requests the data again.

It would be better to use httr::content(api_get) which parses the response we already have (using readr too) rather than fetching it again.