Learn R Programming

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

collapse (version 1.4.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, flexible and parsimonious to code with, class-agnostic and programmer friendly. It is well integrated with base R, 'dplyr' / (grouped) 'tibble', 'data.table' and 'plm' (panel-series and data frames), and non- destructively handles other matrix or data frame based classes (such as 'ts', 'xts' / 'zoo', 'timeSeries', 'tsibble', 'sf' data frames etc.) --- Key Features: --- (1) Advanced statistical programming: A full set of fast statistical functions supporting grouped and weighted computations on vectors, matrices and data frames. Fast and programmable grouping, ordering, unique values / rows, factor generation and interactions. Fast and flexible functions for data manipulation and data object conversions. (2) Advanced aggregation: Fast and easy multi-data-type, multi-function, weighted, parallelized and fully customized data aggregation. (3) Advanced transformations: Fast (grouped) replacing and sweeping out of statistics, and (grouped, weighted) scaling / standardizing, between (averaging) and (quasi-)within (centering / demeaning) transformations, higher-dimensional centering (i.e. multiple fixed effects transformations), linear prediction / partialling-out, linear model fitting and testing. (4) Advanced time-computations: Fast (sequences of) lags / leads, and (lagged / leaded, iterated, quasi-, log-) differences and (compounded) growth rates on (unordered) time series and panel data. Multivariate auto-, partial- and cross-correlation functions for panel data. Panel data to (ts-)array conversions. (5) List processing: (Recursive) list search / identification, splitting, extraction / subsetting, data-apply, and generalized recursive row-binding / unlisting in 2D. (6) Advanced data exploration: Fast (grouped, weighted, panel-decomposed) summary statistics for complex multilevel / panel data.

Copy Link

Version

Install

install.packages('collapse')

Monthly Downloads

38,990

Version

1.4.0

License

GPL (>= 2) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sebastian Krantz

Last Published

November 1st, 2020

Functions in collapse (1.4.0)

A0-collapse-documentation

Collapse Documentation & Overview
GGDC10S

Groningen Growth and Development Centre 10-Sector Database
colorder

Fast Reordering of Data Frame Columns
BY

Split-Apply-Combine Computing
collapse-options

collapse Package Options
TRA

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

Advanced and Fast Data Transformation
collap

Advanced Data Aggregation
GRP, fgroup_by

Fast Grouping / collapse Grouping Objects
collapse-depreciated

Depreciated collapse Functions
descr

Detailed Statistical Description of Data Frame
has_elem, get_elem

Find and Extract / Subset List Elements
fNdistinct

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

Fast (Grouped) Observation Count for Matrix-Like Objects
dapply

Data Apply
A6-data-transformations

Data Transformations
A2-fast-grouping-ordering

Fast Grouping and Ordering
A3-fast-data-manipulation

Fast Data Manipulation
fFtest

Fast F-test for Linear Models (with Factors)
ffirst, flast

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

Fast Growth Rates for Time Series and Panel Data
fHDbetween, fHDwithin

Higher-Dimensional Centering and Linear Prediction
A1-fast-statistical-functions

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

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

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

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

Fast Subsetting Matrix-Like Objects
fmin, fmax

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

Fast (Weighted) Linear Model Fitting
groupid

Generate Run-Length Type Group-Id
fvar, fsd

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

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

Fast Removal of Unused Factor Levels
flag

Fast Lags and Leads for Time Series and Panel Data
qF, qG, finteraction

Fast Factor Generation, Interactions and Vector Grouping
qsu

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

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

Determine the Depth / Level of Nesting of a List
is.regular, is.unlistable

Regular Objects and Unlistable Lists
AA1-recode-replace

Recode and Replace Values in Matrix-Like Objects
rapply2d

Recursively Apply a Function to a List of Data Objects
fmedian

Fast (Grouped, Weighted) Median Value for Matrix-Like Objects
fmode

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

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

Fast Reordering of Data Frame Rows
frename

Fast Renaming Objects
ftransform

Fast Transform and Compute Columns on a Data Frame
funique

Fast Unique Elements / Rows
fscale

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

Matrix / Array from Panel Series
pwcor, pwcov, pwNobs

Pairwise Correlations, Covariances and Observation Count
A9-summary-statistics

Summary Statistics
A7-time-series-panel-series

Time Series and Panel Series
AA2-small-helpers

Small (Helper) Functions
rsplit

Recursive Splitting
A4-quick-conversion

Quick Data Conversion
varying

Fast Check of Variation in Data
radixorder

Fast Radix-Based Ordering
psacf

Auto- and Cross- Covariance and Correlation Function Estimation for Panel Series
A8-list-processing

List Processing
fselect, get_vars, add_vars

Fast Select, Replace or Add Data Frame Columns
seqid

Generate Group-Id from Integer Sequences
wlddev

World Development Dataset
unlist2d

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