GitHub package versioning #451
Labels
Future Improvement
Minimum viable function complete, issue includes potential future improvements
Helpful User Feedback
More Research Needed
Package Management
Top Priority
Is your feature request related to a problem? Please describe.
Users would like to be able to check what version of the R package they are using, and if they already have the most recent version installed.
Describe the solution you'd like
Add the version to the start up message when the package loads via library(TADA). See example code below.
See: https://stackoverflow.com/questions/67986577/how-to-create-custom-start-up-messages-for-r-packages
https://stackoverflow.com/questions/2192360/library-package-development-message-when-loading
Then, use “packageVersion” to get current version and “available.packages” to get CRAN version.
Probably need to use tryCatch to avoid timeout issues (or when user does not have internet).
Here is what ggplot2 has at startup:
https://github.com/tidyverse/ggplot2/blob/main/R/zzz.R
That all assumes CRAN. If working only on GitHub for the package it is more complicated.
Example code below
The kicker here is you have to use “releases” on GitHub. If you do it works.
Here is a package I did for MD DNR.
https://github.com/leppott/MBSStools/releases
And it matches.
There might be other ways.
Hope this helps,
Erik
The text was updated successfully, but these errors were encountered: