tables_by_formulas()
ModelMatrix()
function and its formula
parameter.data.frame
that contains the results for all tables.model_aggregate()
avoid_hierarchical
, input_in_output
, and total
are direct parameters to model_aggregate()
.
ModelMatrix()
parameters (avoidHierarchical
, inputInOutput
, and total
)
had to be set via the mm_args
parameter. Old code remains functional.tibble
and data.table
input (parameter data
).
as.data.frame()
to ensure consistent behavior.model_aggregate()
can now be speeded up.
aggregate_pkg = "data.table"
to utilize this possibility.
Also note the related new parameter aggregate_base_order
.aggregate_na
, to control handling of missing values in grouping variables.
NAomit
parameter to Formula2ModelMatrix()
,
which makes it meaningful to include NAs in the grouping variables.aggregate_na = TRUE
, NAs in grouping variables are retained during pre-aggregation.GaussSuppression()
– now removes duplicate rows **
removeDuplicated
parameter.ModelMatrix()
that uses the hierarchies
parameter together with inputInOutput = FALSE
.printXdim
, which can be used to print
information about dimensional changes to the console.map_hierarchies_to_data()
when_overwritten
.add_comment
.hierarchies_as_vars()
drop_codes
and include_codes
.combine_formulas()
is fixed
"+"
operator,filter_by_variable()
and names_by_variable()
are functions toExtend0fromModelMatrixInput()
, marked as internal, is a specialized version of Extend0()
ModelMatrix()
.AutoHierarchies()
has been updated to recognize common from-to names,
and the sign
variable is now optional.
autoNames
for details on common from-to names.autoLevel
, with a default value (TRUE
)
that ensures the function behaves as it always has.get_klass()
in the
klassR package
or hier_create()
in the
sdcHierarchies package
can now be used directly as input.a <- get_klass(classification = "24")
b <- hier_create(root = "Total", nodes = LETTERS[1:5])
AutoHierarchies(list(tree = a, letter = b))
hierarchies_as_vars()
:
vars_to_hierarchies()
:
hierarchies_as_vars()
.map_hierarchies_to_data()
:
hierarchies_as_vars()
to transform hierarchies, followed by mapping to the dataset.max_contribution()
with wrapper n_contributors()
.
MaxContribution()
and Ncontributors()
developed in the
GaussSuppression package.table_all_integers()
.
total_collapse()
.
substitute_formula_vars()
.
?formula_utils
.formula_include_hierarchies()
, which has been renamed for clarity
and corrected to produce the intended output.FormulaSums()
when viaSparseMatrix = TRUE
.
NAomit
.viaSparseMatrix = FALSE
) already handled this correctly.Extent0()
.
hierarchical = FALSE
.FormulaSelection()
and its identical wrapper formula_selection()
.
FormulaSelection()
and thereby the identical wrapper formula_selection()
have been generalized.
logical
: When TRUE
, the logical selection vector is returned.FormulaSelection()
is now a generic function, allowing methods for other input objects to be added.GaussSuppression()
function and related functionality have now been documented in a "Privacy in Statistical Databases 2024" paper.
data.table
package is listed under Suggests and can be utilized in two functions.
See below.aggregate_by_pkg()
data.table
.include_na
: A logical value indicating whether NA
values in the grouping variables should be included in the aggregation. Default is FALSE
.NAomit
is new parameter to RowGroups()
and Formula2ModelMatrix()
/FormulaSums()
.
ModelMatrix()
.pkg
is new parameter to RowGroups()
"base"
(default) or "data.table"
(for improved speed).Formula2ModelMatrix()
/FormulaSums()
.
ModelMatrix()
.Matrix::sparseMatrix()
instead of building the transposed matrix with rbind()
based on numerous Matrix::fac2sparse()
calls.rowGroupsPackage
, to data.table
.ModelMatrix()
is fixed.
viaOrdinary = TRUE
, model.matrix()
or sparse.model.matrix()
was called twice.combine_formulas()
is improved
ModelMatrix()
function and related functionality for hierarchical computations have now been documented in a paper in The R Journal.
remove_empty
is an explicit parameter to model_aggregate()
.
mm_args
parameter. Old code works as before. ?formula_utils
Extend0()
to allow even more advanced possibilities by varGroups
-attribute.GaussSuppression()
,
"anySum"
in GaussSuppression()
to align with best theory.
singletonMethod
to either "anySumOld"
or "anySumNOTprimaryOld"
.quantile_weighted()
.
quantile_weighted(x=c(0,2,0), weights = c(1,1,0))
correctly outputs the 50% value as 1.CheckInput()
or check_input()
.