A C/C++ based package for advanced data transformation and statistical computing in R that is extremely fast, class-agnostic, robust and programmer friendly.
The core functionality includes a rich set of S3 generic groped and weighted statistical functions for vectors, matrices, and data frames, which provide efficient low-level vectorizations, OpenMP multithreading, and skip missing values by default.
These are integrated with fast grouping and ordering algorithms (also callable from C), and efficient data manipulation functions.
The package also provides a flexible and rigorous approach to time series and panel data in R.
It is well integrated with base R classes, the tidyverse, data.table, sf, plm and xts/zoo.
The collapse R package is available on CRAN, GitHub and on the package website.
The package website contains useful vignettes for various topics.
The blog post Efficient Grouped Programming in R and/or C/C++ with the collapse Package contains useful information.
Krantz (2024). collapse: Advanced and Fast Data Transformation in R. R package version 2.0.9. doi:10.5281/zenodo.8433090. https://sebkrantz.github.io/collapse/.