|
| 1 | +--- |
| 2 | +title: "Published our first externally collaborated R package, osdc" |
| 3 | +description: | |
| 4 | + Over the last two years, we've collaborated with a researcher at Steno Aarhus on building an |
| 5 | + R package called osdc. This package, titled |
| 6 | + *Open Source Diabetes Classifier*, classifies diabetes status in the |
| 7 | + Danish registers. And finally, we've published it to CRAN! |
| 8 | +author: |
| 9 | +- Luke W. Johnston |
| 10 | +date: "2025-12-18" |
| 11 | +categories: |
| 12 | + - packaging |
| 13 | + - publishing |
| 14 | + - programming |
| 15 | +--- |
| 16 | + |
| 17 | +On December 10th, 2025, we finally published our first R package to |
| 18 | +[CRAN](https://cran.r-project.org/)! :tada: |
| 19 | + |
| 20 | +The package is called |
| 21 | +[osdc](https://cran.r-project.org/web/packages/osdc/index.html), or |
| 22 | +"Open Source Diabetes Classifier", and it is our first package that |
| 23 | +we've built in collaboration with an external researcher, [Anders Aasted |
| 24 | +Isaksen](https://www.stenoaarhus.dk/kontakt/anders-aasted-isaksen/). He |
| 25 | +developed an algorithm to classify type 1 and type 2 diabetes using |
| 26 | +Danish registers as data sources, and we worked together to turn this |
| 27 | +algorithm into an R package that others can use. We started the |
| 28 | +collaboration back in 2023, and after a lot of work, we finally got it |
| 29 | +to a stage that we could publish a first version to CRAN. |
| 30 | + |
| 31 | +The package has two aims (as described in the package |
| 32 | +[documentation](https://steno-aarhus.github.io/osdc/)): |
| 33 | + |
| 34 | +1. To provide an open-source, code-based algorithm to classify type 1 |
| 35 | + and type 2 diabetes using Danish registers as data sources. There |
| 36 | + are other diabetes algorithms developed in Denmark for the |
| 37 | + registers, but they are not open source nor packaged into a reusable |
| 38 | + format. |
| 39 | +2. To inspire discussions within the Danish register-based research |
| 40 | + space on the openness and ease of use on the existing tooling and |
| 41 | + registers, and on the need for an official process for updating or |
| 42 | + contributing to existing data sources. |
| 43 | + |
| 44 | +## Who is it for and why use it? |
| 45 | + |
| 46 | +The main reason for building the osdc package was to provide a tool for |
| 47 | +researchers doing diabetes research with Danish register data to |
| 48 | +classify diabetes. There are no Danish registers that fully captures the |
| 49 | +different ways that a person could be classified with diabetes, as |
| 50 | +administrative diagnosis data is not always complete nor accurate. So, |
| 51 | +researchers have had to develop different algorithms to get a better |
| 52 | +idea of who has diabetes in the Danish registers. |
| 53 | + |
| 54 | +However, these algorithms have not been open source, and they have not |
| 55 | +been packaged into reusable tools. Which has lead to many researchers |
| 56 | +having different "in-house" solutions for their group or organisation |
| 57 | +that other groups can't really use effectively. We wanted to change |
| 58 | +that. |
| 59 | + |
| 60 | +So, we built the osdc package with all the necessary details for |
| 61 | +researchers to classify diabetes status in their own Danish register |
| 62 | +data. For example, the package provides a list of which registers and |
| 63 | +variables are needed with the use of the `registers()` function. Other |
| 64 | +than a few other helper functions, the main function of the package is |
| 65 | +`classify_diabetes()`, which takes all the required registers and |
| 66 | +outputs a data frame with a list of individuals, their diabetes status, |
| 67 | +and the date when the classification was made. |
| 68 | + |
| 69 | +Aside from those functions, the package provides an `algorithm()` |
| 70 | +function that lists all the specific criteria used in the algorithm. |
| 71 | +This makes it easier for others to assess how exactly the algorithm |
| 72 | +classifies diabetes. |
| 73 | + |
| 74 | +The next step is to start using the osdc package in collaborating |
| 75 | +projects that use Denmark Statistics and register data :tada: |
0 commit comments