Learn R Programming

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

collapse (version 1.7.5)

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', 'plm' (panel-series and data frames), 'sf' data frames, and non-destructively handles other matrix or data frame based classes (such as 'ts', 'xts' / 'zoo', 'timeSeries', 'tsibble', 'tibbletime' 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, data object conversions, and memory efficient R programming. (2) Advanced aggregation: Fast and easy multi-data-type, multi-function, weighted, parallelized and fully custom data aggregation. (3) Advanced transformations: Fast row / column arithmetic, (grouped) replacing and sweeping out of statistics, (grouped, weighted) scaling / standardizing, between (averaging) and (quasi-)within (demeaning) transformations, higher-dimensional centering (i.e. multiple fixed effects or polynomials), linear prediction, model fitting and testing exclusion restrictions. (4) Advanced time-computations: Fast (sequences of) lags / leads, and (lagged / leaded, iterated, quasi-, log-) differences and (compounded) growth rates on (irregular) 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, 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.7.5

License

GPL (>= 2) | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sebastian Krantz

Last Published

February 3rd, 2022

Functions in collapse (1.7.5)

collapse-documentation

Collapse Documentation & Overview
GGDC10S

Groningen Growth and Development Centre 10-Sector Database
GRP

Fast Grouping / collapse Grouping Objects
collapse-options

collapse Package Options
BY

Split-Apply-Combine Computing
across

Apply Functions Across Multiple Columns
collapse-depreciated

Depreciated collapse Functions
collap

Advanced Data Aggregation
TRA

Transform Data by (Grouped) Replacing or Sweeping out Statistics
data-transformations

Data Transformations
arithmetic

Fast Row/Column Arithmetic for Matrix-Like Objects
collapse-package

Advanced and Fast Data Transformation
descr

Detailed Statistical Description of Data Frame
fFtest

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

Renamed Functions
get_elem

Find and Extract / Subset List Elements
colorder

Fast Reordering of Data Frame Columns
fdroplevels

Fast Removal of Unused Factor Levels
fdiff

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

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

Data Apply
fgrowth

Fast Growth Rates for Time Series and Panel Data
fast-grouping-ordering

Fast Grouping and Ordering
fast-data-manipulation

Fast Data Manipulation
fast-statistical-functions

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

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

Fast Lags and Leads for Time Series and Panel Data
fhdbetween-fhdwithin

Higher-Dimensional Centering and Linear Prediction
fprod

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

Fast (Weighted) Linear Model Fitting
fnth

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

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

Fast Subsetting Matrix-Like Objects
is_unlistable

Unlistable Lists
fsum

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

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

Fast Transform and Compute Columns on a Data Frame
fsummarise

Fast Summarise
ldepth

Determine the Depth / Level of Nesting of a List
funique

Fast Unique Elements / Rows
fnobs

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

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

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

Fast Renaming and Relabelling Objects
fscale

Fast (Grouped, Weighted) Scaling and Centering of Matrix-like Objects
pwcor-pwcov-pwnobs

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

Matrix / Array from Panel Series
efficient-programming

Small Functions to Make R Programming More Efficient
quick-conversion

Quick Data Conversion
group

Fast Hash-Based Grouping
radixorder

Fast Radix-Based Ordering
psacf

Auto- and Cross- Covariance and Correlation Function Estimation for Panel Series
ffirst-flast

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

Recursive Splitting
roworder

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

Time Series and Panel Series
t_list

Efficient List Transpose
varying

Fast Check of Variation in Data
unlist2d

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

Generate Run-Length Type Group-Id
qF-qG-finteraction

Fast Factor Generation, Interactions and Vector Grouping
qsu

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

Small (Helper) Functions
fmean

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

World Development Dataset
summary-statistics

Summary Statistics
pad

Pad Matrix-Like Objects with a Value
fselect-get_vars-add_vars

Fast Select, Replace or Add Data Frame Columns
list-processing

List Processing
rapply2d

Recursively Apply a Function to a List of Data Objects
fmedian

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

Recode and Replace Values in Matrix-Like Objects
seqid

Generate Group-Id from Integer Sequences