Statistics Norway's Miscellaneous Tools
Add leading zeros to numbers while preserving other text
Aggregate by base R or data.table
Wrapper to aggregate
Transform to TsparseMatrix/dgTMatrix
Ensure standardized coding of hierarchies
Creating variables by splitting the elements of a character vector wit...
Combine several data frames by using id variables to match rows
CharacterDataFrame
Checking function inputs
Combine formulas
Cross codes in data frames
crossMerge
Create a (signed) dummy matrix for hierarcical mapping of codes in dat...
DataFrameToMatrix
DimList2Hierarchy
DimList2Hrc/Hrc2DimList
aggregate_multiple_fun
using a dummy matrix
Apply a function to subsets defined by a dummy matrix
Duplicated columns in dummy matrix
Converting hierarchy specifications to a (signed) dummy matrix
Add zero frequency rows
varGroups-attribute to Extend0, Example functions
Factor level correlation
Finding commonCells
Finding dimList
Find directly disclosive cells
Finding hierarchies automatically from data
Finding table(s) of hierarchical variable groups
Fix fun
parameter to aggregate_multiple_fun
Fix vars
parameter to aggregate_multiple_fun
ForceCharacterDataFrame
ForceFactorDataFrame
Generate model formula by specifying which variables have totals or no...
Replace variables in formula with sum of other variables
Functions for formula manipulation
Limit matrix or data frame to selected model terms
Sums (aggregates) and/or sparse model matrix with possible cross table
Linearly independent rows and columns by Gaussian elimination
An iFunction
argument to GaussSuppression
Secondary suppression by Gaussian elimination
Finding hierarchical variable groups
Finding hierarchical variable groups
Finding hierarchical variable groups
Find variable combinations by advanced wildcard/globbing specification...
Model matrix representing crossed hierarchies
Model matrix representing crossed hierarchies according to a formula
Hierarchy2Formula
Hierarchical Computations
Extended Hierarchical Computations
HierarchyComputeDummy
Change the hierarchy table to follow the standard
Default progress indicator function
Non-negative regression fits with a sparse overparameterized model mat...
Microdata frequency data conversion
Make model formula from data taking into account hierarchical variable...
Matching rows in data frames
Simulate Matlab's ':'
Convert matrix to sparse list
Combining columns of a matrix
MatrixToDataFrame
Iterative proportional fitting from matrix input
Hierarchical aggregation via model specification
Overparameterized model matrix
Model matrix from hierarchies and/or a formula
Adding leading zeros
Decoding of singletonMethod
Weighted quantiles
Combining several data frames when the columns don't match
Reducing a non-negative regression problem
Round values that are close two whole numbers
Create numbering according to unique rows
Sorting rows of a matrix or data frame
Function that returns a dataset
Stack columns from a data frame and include variables.
Sequence within unique values
Transform data frame with embedded matrices
Unstack a column from a data frame and include additional variables.
Row selection by wildcard/globbing
Selection of elements by wildcard/globbing
Functions used by other packages from Statistics Norway are gathered. 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 are included (Langsrud, 2023) <doi:10.32614/RJ-2023-088>.
Useful links