How to Assess Usage of your Package
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
As a package maintainer, you might want to get some numbers or impressions on the usage of your package for various reasons: getting some confirmation that your work is useful, prioritizing development on specific features of your software, helping justify a request for funding. Don’t get your hopes too high: there is no perfect solution nor measure. However, we will share some useful information sources in this post – many of them already used and displayed by R-Universe!
Downloads
You can get download data for your package on CRAN or Bioconductor, which you might roughly view as “number of installations”. Even with some correction efforts, these data are fraught as they for instance include downloads for checks on continuous integration.
Reverse dependencies
If your package is not a high-level interface, maybe other packages import it. If many packages depend on your package, then your package is clearly crucial.
For instance here’s a way to count the direct and indirect hard dependencies (Imports) of the curl package on CRAN.
We can count the number of direct (non-recursive) dependencies with pkgcache::meta_cache_revdeps() and recursive = FALSE.
(direct <- length(
unique(
pkgcache::meta_cache_revdeps(
"curl",
recursive = FALSE,
dependencies = "imports"
)$package
)
))
#> [1] 436
We can then calculate the total number of dependencies by using recursive = TRUE.
(total <- length(
unique(
pkgcache::meta_cache_revdeps(
"curl",
recursive = TRUE,
dependencies = "imports"
)$package
)
))
#> [1] 5277
And the number of indirect dependencies by subtracting the two.
(indirect <- total - direct)
#> [1] 4841
R-universe pages for individual packages, like curl, include a badge with the number of indirect hard and soft dependencies (Imports and Suggests).
Code mentions
As some code is published on GitHub, you can use advanced GitHub searches to find instances of use. You can search for occurrences of, say, library(curl) using the URL https://github.com/search?q=library(curl)&type=code.
R-universe displays this information on each package’s page as a badge counting “scripts” using a package – the number of hits for the aforementioned GitHub advanced search query. See curl’s page.
This information is obviously partial as not all code is published, not all code is published on GitHub, and not all code loads packages this way (perhaps also consider searching for curl:: formatting). Nonetheless, such search syntax might help find examples of authentic usage to better understand how users interact with your package: you can look for individual functions, arguments used, etc.
Citations
If your package is used in a scientific paper whose authors cite packages, you might be able to retrieve usage though bibliometric search.
For citations of a package before 2022, you can explore rOpenSci’s citations database.
R-universe displays some data on citations, from the experimental papers dataset of ecosystem.s. See again curl’s page, with a badge linking to ecosyste.ms.
This is again partial information, that might however help underlining the usefulness of your software for scientific endeavours.
Popularity measures: likes
GitHub stars and similar popularity measures do not necessarily correlate with usage, but they are surely at least a nice ego boost. Someone starring your repository, granted the account is not a bot, means someone “saw” your work which might already be valuable to you.
As you might note on curl’s page, R-universe also displays a badge showing the number of GitHub stars.
Surveys
If you have a good idea of what the potential userbase of your package is, or a way to reach a good proportion of current users, maybe you could run a survey to ask about packages and functions most used, and features most dearly missed?
Someone mentioned this idea at the uRos (Use of R in Official Statistics) 2025 conference in their talk.1 For me, as an outsider to that community, it seemed like a perfect idea: National Institutes of Statistics have similar use cases for software and… they know how to run surveys!
Contributions to the repository
Or, the metric we could call engagement in influencers’ parlance. 😇
If you develop your package in the open, users might contribute to it. The mere opening of an issue by an external person means they found and used your package! Furthermore, users themselves might tell you what doesn’t work, what’s missing, what they like about your package… and of course help you maintain the package. All the more reasons to foster a community around your package.
Based on the same idea, if you wonder whether a function is used, you could try removing it or starting to remove it using proper deprecation and seeing if anyone complains. Likewise, and more dramatically, you might hear from users if your package gets archived on CRAN for instance. 😅
At the organization level, you can use our new experimental dashboard to get a bird eye view of repository activity.
Use cases reports
At rOpenSci we collect use cases of packages. You could have a ticket dedicated to receiving users testimonials, like in the quanteda repository. The documentation of your package could point to the place where you would like to hear from users, be it to help you plan future developments, or to keep your motivation up!
The benefit is gathering examples of authentic usage, and also getting the motivation boost from knowing someone uses your tool.
Telemetry
Actually measuring usage at the source is very rare in R packages, but something that for instance the duckplyr maintainers have tried to implement, to inform development priorities. This behavior can be controlled and turned off by users. Informing users of the telemetry is crucial.
We can also wonder about the data collected by Copilot and friends, that you as a package maintainer have no access to: most common questions about your package, code reviewed or suggested by LLMs, etc. One can wonder whether such data might be helpful to software maintainers?
Conclusion
In this post, we gave a quick overview of some means to evaluate usage of your package, including many metrics already featured on the R-universe pages of packages. There is unfortunately no silver bullet, but definitely more to it than counting downloads.
-
But I unfortunately do not remember who. 😭 If that’s you please tell me and I’ll update the post! ↩︎
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.