NIPH R Packages

Registry and documentation for R packages at the Norwegian Institute of Public Health

Overview

We organize packages into two levels:

Project-level packages: Built for specific projects or one-off analyses. Documentation and testing requirements are lighter.

Area-level packages: Shared infrastructure used across multiple teams. These need full documentation, automated testing, and a succession plan.

Package registry

Package Level Maintainer Status
cs9 Project Richard Aubrey White CRAN status
csalert Project Richard Aubrey White CRAN status
csdata Project Richard Aubrey White CRAN status
csdb Project Richard Aubrey White CRAN status
csmaps Project Richard Aubrey White CRAN status
csstyle Project Richard Aubrey White CRAN status
cstidy Project Richard Aubrey White CRAN status
csutil Project Richard Aubrey White CRAN status

Requirements by level

Project-level packages

Area-level packages

Governance

Core team

A core team of 4-5 people handles:

The core team doesn’t build packages. Developers own their packages and coordinate with the core team as needed.

What the core team can and can’t do

The core team can:

The core team can’t:

Management oversight

A steering group (usually area leadership) approves:

Technical standards

Project-level: required

Sensitive data: No real patient data, surveillance records, or other sensitive information. Use synthetic or publicly available example data only.

Licensing: Use MIT unless you have a reason not to.

GitHub Actions: All packages run R CMD check --as-cran on pushes to main and develop, and on pull requests to main. See csalert’s workflow for reference.

Project-level: desirable

Code style: Follow the tidyverse style guide. Format code with air (see this introduction to air).

Testing: Use testthat. See the R Packages testing chapter.

Documentation: Use roxygen2 for function docs and pkgdown for the website. Package sites live at niphr.github.io/<package-name>/.

CRAN submission (if applicable):

Area-level: required

Everything above becomes mandatory, plus:

Testing coverage: 80%+ code coverage.

Version policy:

Dependencies: Keep dependencies on other custom packages to a minimum. Flag any such dependencies during review so we can think through maintenance implications.

Maintenance:

Getting started

Developing a new package

  1. Check this registry for similar packages
  2. Talk to your team lead and the core team to coordinate
  3. Request a repository from the core team. They’ll create it with standard setup (GitHub Actions, license, pkgdown config). Only the core team can create repos in niphr.
  4. Build and test following the standards above
  5. Submit for core team review when ready

Moving from project to area-level

Your package needs to meet all area-level requirements. Submit a brief form to the core team with:

The core team reviews and makes a recommendation. Final approval comes from the steering group, meaning they also commit to funding the succession plan.

Resources


Last updated: 2026-01-28 Questions? Contact RichardAubrey.White@fhi.no