nullcat

[R PACKAGE] Null model algorithms for categorical and quantitative community ecology data

nullcat

Overview

nullcat is an R package that extends classic binary null models to work with categorical data and introduces a stratified randomization framework for continuous community ecology data. The package is now available on CRAN.

Traditional methods provide a well-rounded set of algorithms for binary presence-absence data, but fall short for other data types. Count data (abundance) and continuous data (e.g. presence probability, biomass, cover) are supported only by a limited set of methods that offer less flexibility in which margins are randomized versus held fixed, while categorical data (e.g. phenological stage, interaction type, health status) lack randomization support entirely. nullcat provides tools to randomize these data types while preserving the ecological structure you want to maintain.

Key Features

  • Categorical null models that generalize classic binary algorithms (curveball, swap, trial-swap) to matrices with discrete categories, preserving category multisets rather than simple totals
  • Stratified randomization for continuous data via the quantize() function, which bins continuous values, applies categorical randomization, and maps values back with flexible constraints
  • Efficient batch generation of null distributions with parallel processing support
  • Convergence diagnostics including trace functions and automated burn-in suggestions for sequential algorithms
  • Integration with vegan through commsim objects compatible with nullmodel() and oecosimu()

Resources

The package is available on CRAN and includes a comprehensive vignette covering categorical algorithms, quantitative stratification options, convergence diagnostics, and integration with vegan. The development version is available on GitHub, where you can also report issues and contribute.

Package website: https://matthewkling.github.io/nullcat/

Installation:

install.packages("nullcat")