coderaanalytics / econdatar

R package for uploading and downloading data to/from www.econdata.co.za
MIT License
6 stars 2 forks source link

Using `row.names` as the period interferes with an `OBS_STATUS` column #22

Closed aidanhorn closed 7 months ago

aidanhorn commented 7 months ago

If we are to have one OBS_STATUS column, where multiple values can be present for the same period (and data key), econdatar version 2.2.0 isn't built for this. For example, in econdata_tidy.R we have

d <- unlist2d(x, "data_key", row.names = "period", DT = TRUE) |>

where the idcols="data_key" permit only distinct data keys as the list names, whereas, as @JanPretorius98 pointed out to me, the row.names have to be distinct. How are we going to work around this?

aidanhorn commented 7 months ago

In our meeting this morning, @byrongibby advised that the OBS_STATUS observations have a one-to-one mapping with the period (in the National Treasury category, the Finality is exclusively one type). However, multiple observations for the same series will have to get additional OBS_STATUS columns (with varying column names).