When I was using some more recent(ish) dplyr
functions in my package, I realized I should probably adjust the dependency in my DESCRIPTION
, but I wasn't sure which version of dplyr
I needed to depend on now.
In this case, it was about the scoped variants of mutate
and rename
โ I remember reading about them in update blogposts not too long ago, so I scoured through the NEWS.md and found them introduced in 0.7.0
.
But then I realized that I have no way of actually checking my other package dependencies for specific requirements like that โ the only thing I can tell you is that my package works with the current (and presumably the recent) versions of its dependencies, but that's about it.
I guess this is somewhat similiar to my previous question about which version of R I actually need to depend on, but in this case I feel like there's a great potential for automation.
My idea was simple:
- Parse my
NAMESPACE
file forimportFrom
s (I've been very explicit about documenting external functions I use, this might not be the case for anyone) (EDIT: I remembered that r-lib/itdepends exists, anditdepends::dep_usage_pkg(pkg = "mypkg")
is probably the better choice for this) - The result is a list of packages + functions
- Search a versioned reference of packages for the first appearance of that function
- Profit (in the sense that I now know when that function arrived, so I know that I need at least version x.y.z of a package)
At least in theory. But then I realized that I have no such reference. I was banking on rdrr.io for a list of functions, but there's no version history as far as I can tell, so scraping that won't do me any good. I thought the crandb
package could help, but it doesn't look like it has function information.
And now I'm wondering if it's even worth the effort.
On one hand, I still think that this should be easy to automate, the only missing piece is an index of package name + version + exported functions.
On the other hand, I don't think most other package authors are going this far (at least my googling hasn't lead to much on the topic), so I'm doubting if this is even something the community care or should care about.