I'm building an internal r package for my research team, and expect that it will be updated frequently over the next few months. I have a packageStartupMessage that spits out the version number and the date it was last updated. This is saved in a function called .onAttach which is stored in R/zzz.R.
I am looking at the usethis::use_version() function which seems nice for updating both the DESCRIPTION and NEWS.md files, is there an easy way to get it to also update my packageStartupMessage?
Following up on PJ's nice answer, you can also avoid hard-coding the last-updated date using utils::packageDate().
The one thing to be aware for packageDate() is that it requires the package is installed. Thus if you are developing your package with devtools::load_all(), it will return NA.
Thank you! Combining utils::packageDate and utils::packageVersion is working very nicely in the startup message. I appreciate the heads up about packageDate() and devtools::load_all() as well, mentioning that definitely saved me a lot of head scratching and debugging.