Update: You might also be interested in this discussion on community.rstudio.com about whether or not this is a good approach, and what else you might want to do to ensure you depend meaningfully.
So the other day I was wondering how I could determine the minimum R version I technically need to depend on in my R package. Naturally, I asked #rstats, and I got a neat suggestion which I implemented hastily like this:
|
|
| package | depends |
|---|---|
| DescTools | 3.3.1 |
| car | 3.2.0 |
| pixiedust | 3.1.2 |
| ggplot2 | 3.1 |
| viridis | 2.10 |
| broom | NA |
| magrittr | NA |
| pwr | NA |
| nortest | NA |
So, now I have a neat little table.
Couple things to note:
Current R-devel doesn’t like you to depend on an R version with a non-zero patch-level, i.e. you should depend on R (>= 3.2.0) rather than R (>= 3.2.1).
So even if I want to be safe and depend on the highest dependency in the list (DescTools with R (>= 3.3.1)), I can only really depend on R (>= 3.3.0) and wait for DescTools to comply with the new rules.
The next thing that irks me is that DescTools has such a high dependency, and I couldn’t find out why that has to be or if the devs were just taking the easy route on that one. Since I can’t find the package on GitHub, I guess I won’t be able to easily find that out since I can’t file an issue anywhere.
Lastly, I was surprised that packages like broom or nortest don’t even explicitly depend on any specific R version, I did not know that’s an option. Or if it was an option, I would have assumed it’s discouraged.
So maybe my desire do “depend properly” is totally meaningless anyway and I just should let it go.
So that’s what I’ll do for now.