Advanced and Fast Data Transformation

A large C/C++-based package for advanced data transformation and statistical computing in R that is extremely fast, class-agnostic, robust, and programmer friendly. Core functionality includes a rich set of S3 generic grouped 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, fast functions for data transformation and common statistical procedures, detailed (grouped, weighted) summary statistics, powerful tools to work with nested data, fast data object conversions, functions for memory efficient R programming, and helpers to effectively deal with variable labels, attributes, and missing data. It seamlessly supports base R objects/classes as well as 'units', 'integer64', 'xts'/ 'zoo', 'tibble', 'grouped_df', 'data.table', 'sf', and 'pseries'/'pdata.frame'. For a concise overview of the package see Krantz (2026) .


Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("collapse")

2.1.8 by Sebastian Krantz, 2 months ago


https://fastverse.org/collapse/, https://github.com/fastverse/collapse


Report a bug at https://github.com/fastverse/collapse/issues


Browse source code at https://github.com/cran/collapse


Authors: Sebastian Krantz [aut, cre] (ORCID: , Matt Dowle [ctb] , Arun Srinivasan [ctb] , Morgan Jacob [ctb] , Dirk Eddelbuettel [ctb] , Laurent Berge [ctb] , Kevin Tappe [ctb] , Alina Cherkas [ctb] , Ivan Krylov [ctb] , R Core Team and contributors worldwide [ctb] , Martyn Plummer [cph] , 1999-2016 The R Core Team [cph]


Documentation:   PDF Manual  


GPL (>= 2) | file LICENSE license


Imports Rcpp

Suggests fastverse, data.table, magrittr, kit, xts, zoo, plm, fixest, vars, RcppArmadillo, RcppEigen, tibble, dplyr, ggplot2, scales, microbenchmark, testthat, covr, knitr, rmarkdown, withr, bit64

Linking to Rcpp


Imported by DisImpact, FuncDiv, PiC, SGP, adrftools, africamonitor, amadeus, aorsf, blocs, blvim, bsitar, casimir, cheapr, chopin, cohortBuilder, dcce, deduped, dfadjust, dfms, dggridR, dream, effectplots, fastdid, fastplyr, fastverse, flownet, havel, ife, joyn, mcmcsae, mhpfilter, mooplot, myrror, optweight, osmclass, penppml, plm, plssem, qol, samadb, seqHMM, slideimp, spada, syncdr, timeplyr, ugatsdb, versus, zoomerjoin.

Suggested by VetResearchLMM, VizTest, arcgisutils, bayestestR, ctsem, easystats, epidist, imagefluency, labelr, marginaleffects, modelbased, mvgam, ordbetareg, report, robscale, see, spicy, tinycodet.


See at CRAN