Package: SSBtools 1.6.0

Øyvind Langsrud

SSBtools: Statistics Norway's Miscellaneous Tools

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

Authors:Øyvind Langsrud [aut, cre], Daniel Lupp [aut], Bjørn-Helge Mevik [ctb], Vidar Norstein Klungre [rev], Statistics Norway [cph]

SSBtools_1.6.0.tar.gz
SSBtools_1.6.0.tar.gz(r-4.5-noble)SSBtools_1.6.0.tar.gz(r-4.4-noble)
SSBtools_1.6.0.tgz(r-4.4-emscripten)SSBtools_1.6.0.tgz(r-4.3-emscripten)
SSBtools.pdf |SSBtools.html
SSBtools/json (API)
NEWS

# Install 'SSBtools' in R:
install.packages('SSBtools', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/statisticsnorway/ssb-ssbtools/issues

3.83 score 7 packages 64 scripts 987 downloads 99 exports 11 dependencies

Last updated 22 days agofrom:a2745bde3a. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 04 2024
R-4.5-linuxOKDec 04 2024

Exports:AddLeadingZerosaggregate_by_pkgaggregate_multiple_funAs_TsparseMatrixAutoHierarchiesAutoSplitCbindIdMatchCharacterDataFramecheck_inputCheckInputcombine_formulasCrossCodeFramesDataDummyHierarchiesDataDummyHierarchyDataFrameToMatrixDimList2HierarchyDimList2Hrcdummy_aggregateDummyApplyDummyDuplicatedDummyHierarchiesDummyHierarchyExtend0Extend0rnd1Extend0rnd1bExtend0rnd2FactorLevCorrFindCommonCellsFindDimListsFindDisclosiveCellsFindHierarchiesFindTableGroupfix_fun_amffix_vars_amfForceCharacterDataFrameForceFactorDataFrameformula_from_varsformula_selectionFormula2HierarchyFormula2ModelMatrixFormulaSelectionFormulaSumsGaussIndependentGaussIterationFunctionGaussRankGaussSuppressionHierarchicalGroupsHierarchicalGroups2HierarchicalGroups3HierarchicalWildcardGlobbinghierarchies_as_varsHierarchies2FormulasHierarchies2ModelMatrixHierarchiesAndFormula2ModelMatrixHierarchy2FormulaHierarchyComputeHierarchyCompute2HierarchyComputeDummyHierarchyFixHrc2DimListinc_defaultLSfitNonNegMakeFreqMakeHierFormulaMakeMicromap_hierarchies_to_dataMatchmatlabColonMatrix2listMatrix2listIntMatrixPasteMatrixPaste1MatrixToDataFramemax_contributionMipfmodel_aggregateModelMatrixn_contributorsNamesFromModelMatrixInputNumberNumSingletonquantile_weightedRbindAllReduce0exactRoundWholeRowGroupsSeqIncSortRowsSSBtoolsDataStacksubstitute_formula_varstable_all_integerstotal_collapseUniqueSequnmatrixUnstackvars_to_hierarchiesWildcardGlobbingWildcardGlobbingVector

Dependencies:cligluelatticelifecyclemagrittrMASSMatrixrlangstringistringrvctrs

Readme and manuals

Help Manual

Help pageTopics
Add leading zeros to numbers while preserving other textAddLeadingZeros
Aggregate by base R or data.tableaggregate_by_pkg
Wrapper to 'aggregate'aggregate_multiple_fun
Transform to TsparseMatrix/dgTMatrixAs_TsparseMatrix
Ensure standardized coding of hierarchiesAutoHierarchies
Creating variables by splitting the elements of a character vector without needing a split stringAutoSplit
Combine several data frames by using id variables to match rowsCbindIdMatch
Checking function inputsCheckInput check_input
Create a (signed) dummy matrix for hierarcical mapping of codes in dataDataDummyHierarchies DataDummyHierarchy
DimList2HierarchyDimList2Hierarchy
DimList2Hrc/Hrc2DimListDimList2Hrc Hrc2DimList
'aggregate_multiple_fun' using a dummy matrixdummy_aggregate
Apply a function to subsets defined by a dummy matrixDummyApply
Duplicated columns in dummy matrixDummyDuplicated
Converting hierarchy specifications to a (signed) dummy matrixDummyHierarchies DummyHierarchy
Add zero frequency rowsExtend0
varGroups-attribute to Extend0, Example functionsExtend0rnd1 Extend0rnd1b Extend0rnd2
Factor level correlationFactorLevCorr
Finding commonCellsFindCommonCells
Finding dimListFindDimLists
Find directly disclosive cellsFindDisclosiveCells
Finding hierarchies automatically from dataFindHierarchies
Finding table(s) of hierarchical variable groupsFindTableGroup
Functions for formula manipulationformula_utils
Limit matrix or data frame to selected model termsFormulaSelection FormulaSelection.default formula_selection
Sums (aggregates) and/or sparse model matrix with possible cross tableFormula2ModelMatrix FormulaSums
Linearly independent rows and columns by Gaussian eliminationGaussIndependent GaussRank
An 'iFunction' argument to 'GaussSuppression'GaussIterationFunction
Secondary suppression by Gaussian eliminationGaussSuppression
Finding hierarchical variable groupsHierarchicalGroups
Find variable combinations by advanced wildcard/globbing specifications.HierarchicalWildcardGlobbing
Hierarchies coded as variableshierarchies_as_vars
Model matrix representing crossed hierarchiesHierarchies2ModelMatrix
Model matrix representing crossed hierarchies according to a formulaHierarchiesAndFormula2ModelMatrix
Hierarchy2FormulaFormula2Hierarchy Hierarchies2Formulas Hierarchy2Formula
Hierarchical ComputationsHierarchyCompute
Extended Hierarchical ComputationsHierarchyCompute2
Non-negative regression fits with a sparse overparameterized model matrixLSfitNonNeg
Make model formula from data taking into account hierarchical variablesMakeHierFormula
Add variables to dataset based on hierarchiesmap_hierarchies_to_data
Matching rows in data framesMatch
Simulate Matlab's ':'matlabColon SeqInc
Convert matrix to sparse listMatrix2list Matrix2listInt
Find Major Contributions to Aggregates and Count Contributorsmax_contribution n_contributors
Iterative proportional fitting from matrix inputMipf
Hierarchical aggregation via model specificationmodel_aggregate
Model matrix from hierarchies and/or a formulaModelMatrix NamesFromModelMatrixInput
Adding leading zerosNumber
Decoding of 'singletonMethod'NumSingleton
Weighted quantilesquantile_weighted
Combining several data frames when the columns don't matchRbindAll
Reducing a non-negative regression problemReduce0exact
Round values that are close two whole numbersRoundWhole
Create numbering according to unique rowsRowGroups
Sorting rows of a matrix or data frameSortRows
Function that returns a datasetSSBtoolsData
Stack columns from a data frame and include variables.Stack
Table all integers from 1 to ntable_all_integers
Collapse variables to single representationtotal_collapse
Sequence within unique valuesUniqueSeq
Unstack a column from a data frame and include additional variables.Unstack
Transform hierarchies coded as Variables to "to-from" formatvars_to_hierarchies
Row selection by wildcard/globbingWildcardGlobbing
Selection of elements by wildcard/globbingWildcardGlobbingVector