fastrda: Fast Redundancy Analysis (RDA) with HPC C++ Backend

fastrda is a high-performance implementation of Redundancy Analysis (RDA) for R, written in C++ using Armadillo and OpenMP. It is designed for ecological, genomic, and other large multivariate datasets where computational efficiency is critical.


Features


Installation

CRAN

install.packages("fastrda")

Development version

# install.packages("remotes")
remotes::install_github("zcebeci/fastrda")

Quick Example

library(fastrda)
library(vegan)

data(mite, mite.env)

# Hellinger transformation
Y <- decostand(mite, "hellinger")

# Environmental variables
X <- model.matrix(~ SubsDens + WatrCont, mite.env)[, -1]

fit <- fastrda(
  genotype = Y,
  environment = X,
  axes = 2,
  keep_workspace = "minimal"
)

summary(fit)

# Ordination plot
plot(fit)

Permutation test

anova(fit, permutations = 999)

Direct biplot

biplotrda(fit)

Workspace Modes

Mode Recommended use
"minimal" Permutation testing (recommended default)
"compact" Prediction for new data
"full" Prediction and permutation testing
"none" Lowest memory usage

Documentation

The package vignette contains a complete workflow and additional examples.

vignette("fastrda")

Browse all available documentation:

help(package = "fastrda")

or

browseVignettes("fastrda")

Performance

Internal benchmarks on synthetic datasets containing up to 10,000 response variables showed median speedups of approximately 100× while maintaining numerical accuracy.


License

GPL (>= 3)