Learn R Programming

⚠️There's a newer version (2.1.1) of this package.Take me there.

collapse (version 1.9.0)

Advanced and Fast Data Transformation

Description

A C/C++ based package for advanced data transformation and statistical computing in R that is extremely fast, class-agnostic, and programmer friendly through a flexible, parsimonious, and robust API. 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 and OpenMP multithreading (reducing the need for iteration/vectorization in R), 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 further includes fast functions for 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 is well integrated with basic R, 'dplyr'/'tibble', 'data.table', 'sf', 'plm' (panel-series and data frames), and accommodates (by virtue of smart internal attribute handling) many other classes (like 'ts', 'xts'/'zoo' or 'tsibble').

Copy Link

Version

Install

install.packages('collapse')

Monthly Downloads

30,211

Version

1.9.0

License

GPL (>= 2) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sebastian Krantz

Last Published

January 15th, 2023

Functions in collapse (1.9.0)

across

Apply Functions Across Multiple Columns
GRP

Fast Grouping / collapse Grouping Objects
arithmetic

Fast Row/Column Arithmetic for Matrix-Like Objects
TRA

Transform Data by (Grouped) Replacing or Sweeping out Statistics
collapse-options

collapse Package Options
collap

Advanced Data Aggregation
collapse-documentation

Collapse Documentation & Overview
fast-data-manipulation

Fast Data Manipulation
descr

Detailed Statistical Description of Data Frame
BY

Split-Apply-Combine Computing
collapse-renamed

Renamed Functions
fast-grouping-ordering

Fast Grouping and Ordering
collapse-package

Advanced and Fast Data Transformation
efficient-programming

Small Functions to Make R Programming More Efficient
fdroplevels

Fast Removal of Unused Factor Levels
GGDC10S

Groningen Growth and Development Centre 10-Sector Database
colorder

Fast Reordering of Data Frame Columns
get_elem

Find and Extract / Subset List Elements
fgrowth

Fast Growth Rates for Time Series and Panel Data
dapply

Data Apply
ffirst-flast

Fast (Grouped) First and Last Value for Matrix-Like Objects
data-transformations

Data Transformations
fcount

Efficiently Count Observations by Group
fhdbetween-fhdwithin

Higher-Dimensional Centering and Linear Prediction
fmean

Fast (Grouped, Weighted) Mean for Matrix-Like Objects
fcumsum

Fast (Grouped, Ordered) Cumulative Sum for Matrix-Like Objects
fmin-fmax

Fast (Grouped) Maxima and Minima for Matrix-Like Objects
indexing

Fast Indexed Time Series and Panels
is_unlistable

Unlistable Lists
fFtest

Fast (Weighted) F-test for Linear Models (with Factors)
fnobs

Fast (Grouped) Observation Count for Matrix-Like Objects
fnth-fmedian

Fast (Grouped, Weighted) N'th Element/Quantile for Matrix-Like Objects
fdiff

Fast (Quasi-, Log-) Differences for Time Series and Panel Data
flag

Fast Lags and Leads for Time Series and Panel Data
flm

Fast (Weighted) Linear Model Fitting
fast-statistical-functions

Fast (Grouped, Weighted) Statistical Functions for Matrix-Like Objects
fsubset

Fast Subsetting Matrix-Like Objects
fprod

Fast (Grouped, Weighted) Product for Matrix-Like Objects
fquantile

Fast (Weighted) Sample Quantiles and Range
fsum

Fast (Grouped, Weighted) Sum for Matrix-Like Objects
group

Fast Hash-Based Grouping
funique

Fast Unique Elements / Rows
fbetween-fwithin

Fast Between (Averaging) and (Quasi-)Within (Centering) Transformations
fdist

Fast and Flexible Distance Computations
groupid

Generate Run-Length Type Group-Id
seqid

Generate Group-Id from Integer Sequences
small-helpers

Small (Helper) Functions
psmat

Matrix / Array from Panel Series
fmode

Fast (Grouped, Weighted) Statistical Mode for Matrix-Like Objects
fvar-fsd

Fast (Grouped, Weighted) Variance and Standard Deviation for Matrix-Like Objects
fndistinct

Fast (Grouped) Distinct Value Count for Matrix-Like Objects
wlddev

World Development Dataset
pwcor-pwcov-pwnobs

(Pairwise, Weighted) Correlations, Covariances and Observation Counts
fsummarise

Fast Summarise
pad

Pad Matrix-Like Objects with a Value
ftransform

Fast Transform and Compute Columns on a Data Frame
qF-qG-finteraction

Fast Factor Generation, Interactions and Vector Grouping
qtab

Fast (Weighted) Cross Tabulation
frename

Fast Renaming and Relabelling Objects
psacf

Auto- and Cross- Covariance and Correlation Function Estimation for Panel Series
quick-conversion

Quick Data Conversion
qsu

Fast (Grouped, Weighted) Summary Statistics for Cross-Sectional and Panel Data
recode-replace

Recode and Replace Values in Matrix-Like Objects
roworder

Fast Reordering of Data Frame Rows
time-series-panel-series

Time Series and Panel Series
radixorder

Fast Radix-Based Ordering
fscale

Fast (Grouped, Weighted) Scaling and Centering of Matrix-like Objects
ldepth

Determine the Depth / Level of Nesting of a List
timeid

Generate Integer-Id From Time/Date Sequences
summary-statistics

Summary Statistics
t_list

Efficient List Transpose
rapply2d

Recursively Apply a Function to a List of Data Objects
unlist2d

Recursive Row-Binding / Unlisting in 2D - to Data Frame
list-processing

List Processing
rsplit

Fast (Recursive) Splitting
fselect-get_vars-add_vars

Fast Select, Replace or Add Data Frame Columns
varying

Fast Check of Variation in Data