Learn R Programming

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

SSBtools (version 1.5.4)

Statistics Norway's Miscellaneous Tools

Description

Functions used by other packages from Statistics Norway are gathered. General data manipulation functions, algorithms for statistical disclosure control (Langsrud, 2024) and functions for hierarchical computations by sparse model matrices are included (Langsrud, 2023) .

Copy Link

Version

Install

install.packages('SSBtools')

Monthly Downloads

990

Version

1.5.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Oyvind Langsrud

Last Published

September 20th, 2024

Functions in SSBtools (1.5.4)

FindDisclosiveCells

Find directly disclosive cells
DataFrameToMatrix

DataFrameToMatrix
AutoSplit

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

Finding hierarchies automatically from data
DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix
HierarchicalGroups3

Finding hierarchical variable groups
DataDummyHierarchy

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

Find variable combinations by advanced wildcard/globbing specifications.
Extend0

Add zero frequency rows
HierarchyCompute

Hierarchical Computations
HierarchyFix

Change the hierarchy table to follow the standard
FindCommonCells

Finding commonCells
GaussIterationFunction

An iFunction argument to GaussSuppression
LSfitNonNeg

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

Finding dimList
dummy_aggregate

aggregate_multiple_fun using a dummy matrix
RowGroups

Create numbering according to unique rows
CheckInput

Checking function inputs
RbindAll

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

Function that returns a dataset
CrossCodeFrames

Cross codes in data frames
WildcardGlobbing

Row selection by wildcard/globbing
AddLeadingZeros

Add leading zeros to numbers while preserving other text
Reduce0exact

Reducing a non-negative regression problem
DimList2Hierarchy

DimList2Hierarchy
GaussSuppression

Secondary suppression by Gaussian elimination
HierarchyComputeDummy

HierarchyComputeDummy
formula_include_hierarchies

Replace variables in formula with sum of other variables
As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix
ForceFactorDataFrame

ForceFactorDataFrame
FormulaSelection

Limit matrix or data frame to selected model terms
Extend0rnd1

varGroups-attribute to Extend0, Example functions
DimList2Hrc

DimList2Hrc/Hrc2DimList
WildcardGlobbingVector

Selection of elements by wildcard/globbing
HierarchicalGroups

Finding hierarchical variable groups
UniqueSeq

Sequence within unique values
FactorLevCorr

Factor level correlation
FindTableGroup

Finding table(s) of hierarchical variable groups
HierarchicalGroups2

Finding hierarchical variable groups
HierarchyCompute2

Extended Hierarchical Computations
combine_formulas

Combine formulas
MatrixPaste

Combining columns of a matrix
MatrixToDataFrame

MatrixToDataFrame
SortRows

Sorting rows of a matrix or data frame
Mipf

Iterative proportional fitting from matrix input
HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula
Hierarchy2Formula

Hierarchy2Formula
RoundWhole

Round values that are close two whole numbers
matlabColon

Simulate Matlab's ':'
Stack

Stack columns from a data frame and include variables.
ForceCharacterDataFrame

ForceCharacterDataFrame
ModelMatrix

Model matrix from hierarchies and/or a formula
MakeFreq

Microdata frequency data conversion
crossMerge

crossMerge
fix_fun_amf

Fix fun parameter to aggregate_multiple_fun
Model_Matrix

Overparameterized model matrix
Number

Adding leading zeros
DummyApply

Apply a function to subsets defined by a dummy matrix
CbindIdMatch

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

Make model formula from data taking into account hierarchical variables
Matrix2list

Convert matrix to sparse list
model_aggregate

Hierarchical aggregation via model specification
quantile_weighted

Weighted quantiles
CharacterDataFrame

CharacterDataFrame
Unstack

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

Fictitious datasets returned by SSBtoolsData()
NumSingleton

Decoding of singletonMethod
unmatrix

Transform data frame with embedded matrices
FormulaSums

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

Duplicated columns in dummy matrix
formula_utils

Functions for formula manipulation
inc_default

Default progress indicator function
fix_vars_amf

Fix vars parameter to aggregate_multiple_fun
GaussIndependent

Linearly independent rows and columns by Gaussian elimination
Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies
Match

Matching rows in data frames
aggregate_by_pkg

Aggregate by base R or data.table
aggregate_multiple_fun

Wrapper to aggregate
formula_from_vars

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

Ensure standardized coding of hierarchies