MattCowgill / readabs

Download and tidy time series data from the Australian Bureau of Statistics in R
https://mattcowgill.github.io/readabs/
Other
101 stars 22 forks source link

Read abs api #164

Closed Annabel-Kennedy closed 3 years ago

Annabel-Kennedy commented 3 years ago

Hi Matt,

I apologise for the delay in creating this pull request; however, I hope these functions are useful to your package! The request contains all 7 functions that ingest, tidy and describe flat format data from the ABS' SDMX-JSON API. For convenience I have pasted a copy of their descriptions and examples below again (as a few of the functions were renamed):

Exported functions:

Helper functions:

read_abs_api examples: ABS.Stat SDMX-JSON API URL:

old_url <- “http://stat.data.abs.gov.au/sdmx-json/data/ALC/all/all?startTime=2000&endTime=2016&dimensionAtObservation=allDimensions”
read_abs_api(old_url)

New API URL:

new_url <- “https://api.data.abs.gov.au/data/ABS,RES_DWELL/all?startPeriod=2019-Q4&endPeriod=2020-Q1&format=jsondata&dimensionAtObservation=AllDimensions”
read_abs_api(new_url)

I'm happy to answer any questions/change anything relating to these functions :) Thanks!

Kind regards, Annabel

MattCowgill commented 3 years ago

Hi @Annabel-Kennedy, thank you so much for this contribution. Sorry for the delay in getting back to you. I will review as soon as I can.

MattCowgill commented 3 years ago

Hi @Annabel-Kennedy and @baslat, thanks again for all your work on this. I'm going to merge this PR into a read_abs_api branch here and do some work on it myself.

What's the benefit of adding the abs_clipboard() wrapper around readClipboard()?

Annabel-Kennedy commented 3 years ago

Hi @MattCowgill,

No worries! I would say the benefit of the abs_clipboard() wrapper is its added documentation for users; however, obviously this can be removed :)

Some of the changes made to fix the previous errors have caused conflicts, which I have not had the opportunity to look at yet with my uni load and work. Sorry about this. Thank you very much!

MattCowgill commented 3 years ago

No worries, thanks again @Annabel-Kennedy. Sorry again for the delay reviewing this

baslat commented 3 years ago

Thanks both, and I agree with @Annabel-Kennedy re documentation. Having abs_clipboard() exported along with abs_api() (noting I think the function name has chagned for this PR) meant that the user saw the two abs_* functions and helped remind them of the weird process needed with the really long URLs, so there was also an element of convenience.

MattCowgill commented 3 years ago

Thank you both! I've merged into the read_abs_api branch here; any further changes will be made there before merging to master via this PR https://github.com/MattCowgill/readabs/pull/168