rOpenGov / eurostat

R tools for Eurostat data
http://ropengov.github.io/eurostat
Other
235 stars 46 forks source link

Better integration with regions #218

Closed antaldaniel closed 3 years ago

antaldaniel commented 3 years ago

I would suggest the following simple integration steps

  1. Whenever the user downloads a dataset, and the dataset contains regional geo codes (this can be established with a very quick call) the user gets a message that special care is needed and prompted to review the regional vignette, and/or run validate_nuts_codes.

  2. I would import and put into the eurostat documentation the two crucial functions of regions, validate_nuts_code, and recode_nuts, becuase these are essential to work with the regional datasets. The rest of regions (imputations, etc.) should remain there, as they are non-essential and not trivial tasks.

The extra validation step can be done with a very cheap call, as we only have to check the geo code character lenghs, and rule out excpetions like EU27 and EA19, other than these, if the geo codes are longer than 2 characters, i.e. the country codes, validation is almost always necessary.

Importing two functions will not add a big burden to eurostat, because the joint vignette will anyway suggest the entire regions package, which, in turn, is not very heavy, it often refers back to eurostat itself.

@antagomir , @pitkant , what do you think?

antagomir commented 3 years ago

Sounds good to me at least. Could you make the PR?

antaldaniel commented 3 years ago

Included in PR 220