steno-aarhus / osdc

Open-Source Diabetes Classifier: an R package to classify diabetes status in Danish registers
https://steno-aarhus.github.io/osdc/
Other
1 stars 1 forks source link

feat: include variable description as exported dataset as well as a function to get the required variables #48

Closed lwjohnst86 closed 6 months ago

lwjohnst86 commented 6 months ago

This closes #16 and is a stacked PR the depends on #45.

I originally had the required_variables as an internal dataset, but it makes more sense that more of the variable-description data is "exported" (available to the user) so that they can use that if needed. Converting into a "exported" object is done by saving it to data/ as a .rda object (via usethis::use_data()).

I included documentation on that dataset in R/variable-description.R.

I created an get_ helper function to extract the required variables from a given register (along with unit tests for the helper functions).