SSBtools1.8.1 package

Algorithms and Tools for Tabular Statistics and Hierarchical Computations

AddLeadingZeros

Add leading zeros to numbers while preserving other text

aggregate_by_pkg

Aggregate by base R or data.table

aggregate_multiple_fun

Wrapper to aggregate

As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix

AutoHierarchies

Ensure standardized coding of hierarchies

AutoSplit

Creating variables by splitting the elements of a character vector wit...

CbindIdMatch

Combine several data frames by using id variables to match rows

CharacterDataFrame

CharacterDataFrame

CheckInput

Checking function inputs

combine_formulas

Combine formulas

CrossCodeFrames

Cross codes in data frames

crossMerge

crossMerge

DataDummyHierarchy

Create a (signed) dummy matrix for hierarcical mapping of codes in dat...

DataFrameToMatrix

DataFrameToMatrix

DimList2Hierarchy

DimList2Hierarchy

DimList2Hrc

DimList2Hrc/Hrc2DimList

dummy_aggregate

aggregate_multiple_fun using a dummy matrix

DummyApply

Apply a function to subsets defined by a dummy matrix

DummyDuplicated

Duplicated columns in dummy matrix

DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix

Extend0

Add zero frequency rows

Extend0fromModelMatrixInput

A specialized version of Extend0()

Extend0rnd1

varGroups-attribute to Extend0, Example functions

FactorLevCorr

Factor level correlation

filter_by_variable

Filter a List of Items or Retrieve Names by a Variable

FindCommonCells

Finding commonCells

FindDimLists

Finding dimList

FindDisclosiveCells

Find directly disclosive cells

FindHierarchies

Finding hierarchies automatically from data

FindTableGroup

Finding table(s) of hierarchical variable groups

fix_fun_amf

Fix fun parameter to aggregate_multiple_fun

fix_vars_amf

Fix vars parameter to aggregate_multiple_fun

ForceCharacterDataFrame

ForceCharacterDataFrame

ForceFactorDataFrame

ForceFactorDataFrame

formula_from_vars

Generate model formula by specifying which variables have totals or no...

formula_term_labels

Retrieve term labels from a formula

formula_utils

Functions for formula manipulation

FormulaSelection

Limit matrix or data frame to selected model terms

FormulaSums

Sums (aggregates) and/or sparse model matrix with possible cross table

GaussIndependent

Linearly independent rows and columns by Gaussian elimination

GaussIterationFunction

An iFunction argument to GaussSuppression

GaussSuppression

Secondary suppression by Gaussian elimination

HierarchicalGroups

Finding hierarchical variable groups

HierarchicalGroups2

Finding hierarchical variable groups

HierarchicalGroups3

Finding hierarchical variable groups

HierarchicalWildcardGlobbing

Find variable combinations by advanced wildcard/globbing specification...

hierarchies_as_vars

Hierarchies coded as variables

Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies

HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula

Hierarchy2Formula

Hierarchy2Formula

HierarchyCompute

Hierarchical Computations

HierarchyCompute2

Extended Hierarchical Computations

HierarchyComputeDummy

HierarchyComputeDummy

HierarchyFix

Change the hierarchy table to follow the standard

inc_default

Default progress indicator function

LSfitNonNeg

Non-negative regression fits with a sparse overparameterized model mat...

MakeFreq

Microdata frequency data conversion

MakeHierFormula

Make model formula from data taking into account hierarchical variable...

map_hierarchies_to_data

Add variables to dataset based on hierarchies

Match

Matching rows in data frames

matlabColon

Simulate Matlab's ':'

Matrix2list

Convert matrix to sparse list

MatrixPaste

Combining columns of a matrix

MatrixToDataFrame

MatrixToDataFrame

max_contribution

Find Major Contributions to Aggregates and Count Contributors

Mipf

Iterative proportional fitting from matrix input

model_aggregate

Hierarchical aggregation via model specification

Model_Matrix

Overparameterized model matrix

ModelMatrix

Model matrix from hierarchies and/or a formula

Number

Adding leading zeros

NumSingleton

Decoding of singletonMethod

output_term_labels

Extract vector of term labels from a data.frame

quantile_weighted

Weighted quantiles

RbindAll

Combining several data frames when the columns don't match

Reduce0exact

Reducing a non-negative regression problem

RoundWhole

Round values that are close two whole numbers

RowGroups

Create numbering according to unique rows

SortRows

Sorting rows of a matrix or data frame

SSBtoolsData

Function that returns a dataset

Stack

Stack columns from a data frame and include variables.

substitute_formula_vars

Replace variables in formula with sum of other variables

table_all_integers

Table all integers from 1 to n

tables_by_formulas

Tabular Statistics Based on Formulas

total_collapse

Collapse variables to single representation

UniqueSeq

Sequence within unique values

unmatrix

Transform data frame with embedded matrices

Unstack

Unstack a column from a data frame and include additional variables.

vars_to_hierarchies

Transform hierarchies coded as Variables to "to-from" format

WildcardGlobbing

Row selection by wildcard/globbing

WildcardGlobbingVector

Selection of elements by wildcard/globbing

Includes general data manipulation functions, algorithms for statistical disclosure control (Langsrud, 2024) <doi:10.1007/978-3-031-69651-0_6> and functions for hierarchical computations by sparse model matrices (Langsrud, 2023) <doi:10.32614/RJ-2023-088>.

  • Maintainer: Øyvind Langsrud
  • License: MIT + file LICENSE
  • Last published: 2025-08-18