Learn R Programming

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

SSBtools (version 1.5.5)

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.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Oyvind Langsrud

Last Published

October 21st, 2024

Functions in SSBtools (1.5.5)

DimList2Hrc

DimList2Hrc/Hrc2DimList
FactorLevCorr

Factor level correlation
FindTableGroup

Finding table(s) of hierarchical variable groups
ForceFactorDataFrame

ForceFactorDataFrame
FormulaSelection.default

Limit matrix or data frame to selected model terms
GaussIterationFunction

An iFunction argument to GaussSuppression
GaussSuppression

Secondary suppression by Gaussian elimination
GaussIndependent

Linearly independent rows and columns by Gaussian elimination
FormulaSums

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

Find directly disclosive cells
FindHierarchies

Finding hierarchies automatically from data
ForceCharacterDataFrame

ForceCharacterDataFrame
HierarchicalGroups

Finding hierarchical variable groups
HierarchyCompute2

Extended Hierarchical Computations
HierarchicalGroups2

Finding hierarchical variable groups
Hierarchy2Formula

Hierarchy2Formula
HierarchicalGroups3

Finding hierarchical variable groups
Hierarchies2ModelMatrix

Model matrix representing crossed hierarchies
HierarchiesAndFormula2ModelMatrix

Model matrix representing crossed hierarchies according to a formula
HierarchyCompute

Hierarchical Computations
HierarchicalWildcardGlobbing

Find variable combinations by advanced wildcard/globbing specifications.
Matrix2list

Convert matrix to sparse list
LSfitNonNeg

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

Iterative proportional fitting from matrix input
HierarchyComputeDummy

HierarchyComputeDummy
MakeHierFormula

Make model formula from data taking into account hierarchical variables
Match

Matching rows in data frames
ModelMatrix

Model matrix from hierarchies and/or a formula
MatrixPaste

Combining columns of a matrix
MatrixToDataFrame

MatrixToDataFrame
HierarchyFix

Change the hierarchy table to follow the standard
MakeFreq

Microdata frequency data conversion
Reduce0exact

Reducing a non-negative regression problem
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.
Unstack

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

Create numbering according to unique rows
aggregate_by_pkg

Aggregate by base R or data.table
UniqueSeq

Sequence within unique values
SSBtoolsData

Function that returns a dataset
WildcardGlobbing

Row selection by wildcard/globbing
Model_Matrix

Overparameterized model matrix
Number

Adding leading zeros
RbindAll

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

aggregate_multiple_fun using a dummy matrix
fix_fun_amf

Fix fun parameter to aggregate_multiple_fun
NumSingleton

Decoding of singletonMethod
aggregate_multiple_fun

Wrapper to aggregate
sosialFiktiv

Fictitious datasets returned by SSBtoolsData()
matlabColon

Simulate Matlab's ':'
inc_default

Default progress indicator function
model_aggregate

Hierarchical aggregation via model specification
quantile_weighted

Weighted quantiles
WildcardGlobbingVector

Selection of elements by wildcard/globbing
formula_utils

Functions for formula manipulation
unmatrix

Transform data frame with embedded matrices
formula_include_hierarchies

Replace variables in formula with sum of other variables
fix_vars_amf

Fix vars parameter to aggregate_multiple_fun
formula_from_vars

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

Combine formulas
crossMerge

crossMerge
DataDummyHierarchy

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

CharacterDataFrame
As_TsparseMatrix

Transform to TsparseMatrix/dgTMatrix
AutoHierarchies

Ensure standardized coding of hierarchies
CheckInput

Checking function inputs
AddLeadingZeros

Add leading zeros to numbers while preserving other text
AutoSplit

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

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

DimList2Hierarchy
DummyApply

Apply a function to subsets defined by a dummy matrix
DummyDuplicated

Duplicated columns in dummy matrix
Extend0rnd1

varGroups-attribute to Extend0, Example functions
DummyHierarchy

Converting hierarchy specifications to a (signed) dummy matrix
FindCommonCells

Finding commonCells
Extend0

Add zero frequency rows
DataFrameToMatrix

DataFrameToMatrix
CrossCodeFrames

Cross codes in data frames
FindDimLists

Finding dimList