Robinlovelace / spanishoddata

Work-in-progress package to get OD data. We may move the repo at some point..
https://robinlovelace.github.io/spanishoddata/
Other
7 stars 0 forks source link

the package should support both v1 (2020-2021) and v2 data (2022 onwards) #5

Open e-kotov opened 2 weeks ago

e-kotov commented 2 weeks ago

Here is a point to discuss.

Functions such as get_metadata https://github.com/Robinlovelace/spanishoddata/blob/bf423611cfcd8586f3a8aaf23d53c04a68302e7b/R/get.R#L28 , as well as the the function to get xml https://github.com/Robinlovelace/spanishoddata/blob/bf423611cfcd8586f3a8aaf23d53c04a68302e7b/R/get.R#L1 should support both v1 (2020-2021) data and v2 data (2022 onwards).

The datasets are not fully compatible, so the the possible approaches are (and they are not mutually exclusive, I guess):

  1. keep the function names distinct (like get_v2_metadata, get_v1_metadata, etc.). This way we nudge the user to read the methodology for both data.
  2. Provide (and highlight in examples and documentation) a wrapper for all v1/v2 functions but issue a warning that the data are not compatible due to different methodology.

Overall, I suggest we focus on v2 data first, but keeping an eye on v1 and it's differences from v2 (for example, in terms of available variables) and in general its existence in the design of functions for v2 is essential.

Robinlovelace commented 2 weeks ago

OK sounds good, getting it working well for the most useful bits of the data first, and then extending from that solid baseline, sounds like a good plan to me. +1 to supporting v2 eventually.