Search code examples
rr-package

Adding a nickname to an R package?


When developping an R package, is it possible to add a nickname to a certain version?

How would this be added in the DESCRIPTION file?

That cannot be in the version, as only numbers are accepted. It could of course be in the description, but it would not be a real metadata.


Solution

  • You can add a field to the DESCRIPTION file for this:

    Package: coolpkg
    Nickname: Coolest Nickname Ever
    Version: 0.1.0
    

    After installing your package you can then get the nickname back like this:

    packageDescription("coolpkg")[["Nickname"]]

    FYI I think CRAN has standards around what can go in the DESCRIPTION file, just something to keep in mind if that's what you're working towards.

    Alternatively, you could just save the nickname as a data object in the package.