Learn R Programming

SSBtools (version 1.7.5)

Algorithms and Tools for Tabular Statistics and Hierarchical Computations

Description

Includes general data manipulation functions, algorithms for statistical disclosure control (Langsrud, 2024) and functions for hierarchical computations by sparse model matrices (Langsrud, 2023) .

Copy Link

Version

Install

install.packages('SSBtools')

Monthly Downloads

969

Version

1.7.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Oyvind Langsrud

Last Published

March 14th, 2025

Functions in SSBtools (1.7.5)

DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix
DimList2Hierarchy

DimList2Hierarchy
Extend0

Add zero frequency rows
DummyApply

Apply a function to subsets defined by a dummy matrix
Extend0rnd1

varGroups-attribute to Extend0, Example functions
Extend0fromModelMatrixInput

A specialized version of Extend0()
FactorLevCorr

Factor level correlation
FindCommonCells

Finding commonCells
DummyDuplicated

Duplicated columns in dummy matrix
ForceCharacterDataFrame

ForceCharacterDataFrame
GaussIndependent

Linearly independent rows and columns by Gaussian elimination
ForceFactorDataFrame

ForceFactorDataFrame
DimList2Hrc

DimList2Hrc/Hrc2DimList
FindDimLists

Finding dimList
FindDisclosiveCells

Find directly disclosive cells
FindHierarchies

Finding hierarchies automatically from data
FindTableGroup

Finding table(s) of hierarchical variable groups
FormulaSums

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

Limit matrix or data frame to selected model terms
HierarchicalGroups2

Finding hierarchical variable groups
HierarchyCompute

Hierarchical Computations
GaussSuppression

Secondary suppression by Gaussian elimination
HierarchyCompute2

Extended Hierarchical Computations
Hierarchy2Formula

Hierarchy2Formula
GaussIterationFunction

An iFunction argument to GaussSuppression
HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula
HierarchicalGroups

Finding hierarchical variable groups
Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies
HierarchicalWildcardGlobbing

Find variable combinations by advanced wildcard/globbing specifications.
HierarchicalGroups3

Finding hierarchical variable groups
LSfitNonNeg

Non-negative regression fits with a sparse overparameterized model matrix
Matrix2list

Convert matrix to sparse list
MatrixPaste

Combining columns of a matrix
Mipf

Iterative proportional fitting from matrix input
MatrixToDataFrame

MatrixToDataFrame
MakeFreq

Microdata frequency data conversion
RbindAll

Combining several data frames when the columns don't match
MakeHierFormula

Make model formula from data taking into account hierarchical variables
Match

Matching rows in data frames
Reduce0exact

Reducing a non-negative regression problem
Model_Matrix

Overparameterized model matrix
ModelMatrix

Model matrix from hierarchies and/or a formula
SSBtoolsData

Function that returns a dataset
SortRows

Sorting rows of a matrix or data frame
RoundWhole

Round values that are close two whole numbers
Stack

Stack columns from a data frame and include variables.
UniqueSeq

Sequence within unique values
RowGroups

Create numbering according to unique rows
dummy_aggregate

aggregate_multiple_fun using a dummy matrix
HierarchyComputeDummy

HierarchyComputeDummy
crossMerge

crossMerge
HierarchyFix

Change the hierarchy table to follow the standard
aggregate_by_pkg

Aggregate by base R or data.table
WildcardGlobbingVector

Selection of elements by wildcard/globbing
Number

Adding leading zeros
NumSingleton

Decoding of singletonMethod
aggregate_multiple_fun

Wrapper to aggregate
formula_utils

Functions for formula manipulation
combine_formulas

Combine formulas
filter_by_variable

Filter a List of Items or Retrieve Names by a Variable
total_collapse

Collapse variables to single representation
quantile_weighted

Weighted quantiles
hierarchies_as_vars

Hierarchies coded as variables
model_aggregate

Hierarchical aggregation via model specification
fix_fun_amf

Fix fun parameter to aggregate_multiple_fun
unmatrix

Transform data frame with embedded matrices
Unstack

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

Find Major Contributions to Aggregates and Count Contributors
WildcardGlobbing

Row selection by wildcard/globbing
matlabColon

Simulate Matlab's ':'
map_hierarchies_to_data

Add variables to dataset based on hierarchies
inc_default

Default progress indicator function
vars_to_hierarchies

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

Fictitious datasets returned by SSBtoolsData()
substitute_formula_vars

Replace variables in formula with sum of other variables
tables_by_formulas

Tabular Statistics Based on Formulas
fix_vars_amf

Fix vars parameter to aggregate_multiple_fun
table_all_integers

Table all integers from 1 to n
formula_from_vars

Generate model formula by specifying which variables have totals or not.
CbindIdMatch

Combine several data frames by using id variables to match rows
DataFrameToMatrix

DataFrameToMatrix
AddLeadingZeros

Add leading zeros to numbers while preserving other text
DataDummyHierarchy

Create a (signed) dummy matrix for hierarcical mapping of codes in data
As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix
AutoHierarchies

Ensure standardized coding of hierarchies
CheckInput

Checking function inputs
AutoSplit

Creating variables by splitting the elements of a character vector without needing a split string
CharacterDataFrame

CharacterDataFrame
CrossCodeFrames

Cross codes in data frames