Like the previous PRs, I've written what and why I'm making changes to code in the commits. Review them if you are interested in the whys of things.
Also, for this package, I'd suggest considering not including code that imports/saves data and keep the package sharply on calculating diabetes status based on input data. One reason being is that, for instance in this PR, you use RDS to store the data, but with data like registers, a format like Apache Parquet is better for faster processing and importing. So the package only has inputs of already loaded data and outputs of only data as tibble/datatable/data.frame, that will also really simplify how much work you put into converting these code into a functioning package and (eventually) submitting to CRAN or something.
Like the previous PRs, I've written what and why I'm making changes to code in the commits. Review them if you are interested in the whys of things.
Also, for this package, I'd suggest considering not including code that imports/saves data and keep the package sharply on calculating diabetes status based on input data. One reason being is that, for instance in this PR, you use RDS to store the data, but with data like registers, a format like Apache Parquet is better for faster processing and importing. So the package only has inputs of already loaded data and outputs of only data as tibble/datatable/data.frame, that will also really simplify how much work you put into converting these code into a functioning package and (eventually) submitting to CRAN or something.