Internal NSWERS R Packages

Contents

    Previously, the use of NSWERS internal R packages has had the potential to be a little bit fragile:
    The recommendation for installation was to install via the remotes packages by having the link to the devops repo. There is the option to install from a particular commit via the refs argument, but releases were not formal, and the default was to install from the HEAD of the main branch.

    So, remotes::install_git("https://NSWERS@dev.azure.com/NSWERS/Research/_git/packagename", git = "external") can be fragile because two people running this on different dates may results in two different versions of the package being installed.

    It’s a bit better if a particular commit is referenced, but then the problem of knowing which particular commit to use arises.

    Formal releases with semantic versions is really the ideal state to get to. The standard for this in the R world is a public repository like CRAN, bioconductor, or perhaps ropensci.

    Our packages should not be provided publicly CRAN or other, because they contain proprietary resources (e.g. RDB links, etc). Thus, we need an alternative way to release and provide these packages.

    The solution for that is azure universal artifacts. This choice reflects a local optimum of a set of desirable properties. These are:

    1. fits within out technology stack
      • we already use azure!
    2. A version of a package can only be released once.
      • Prevents releases of the same version number being overwritten.
    3. Packages can be automatically released with a PR/action.
      • in practice, a PR into main plus a tagged commit triggers a build and release
    4. Possibile to install via script/commands
      • do not have to manually download
      • authentication/authorization is relatively painless
    5. Works with other toolchains
      • specifically, can work smoothly with renv

    All NSWERS internal packages are available today in this azure universal artifacts framework:
    https://dev.azure.com/NSWERS/Research/_artifacts/feed/nswers_r_internal

    Documentation still needs to be written for:

    1. Adding a new package into this system
    2. Releasing a version of a current package
    3. Using this with renv (forthcoming)

    To install from this system, you must first download and then install:

    1. Download

    Make sure you put path somewhere reasonable.

    az artifacts universal download \
      --organization "https://dev.azure.com/NSWERS/" \
      --feed "nswers_r_internal" \
      --name "nswersrmd" \
      --version "0.0.2" \
      --path .
    1. install

    You can do install.packages or renv::install, etc.

    The download includes both the .tar.gz files and the pre-compiled windows binaries. The binaries install faster.

    Updated on March 16, 2026

    Leave a Reply

    Your email address will not be published. Required fields are marked *