Changelog
Source:NEWS.md
mpindex 0.3.0
Breaking changes
- All argument names have dropped the
.prefix (except.data). E.g..mpi_specs→mpi_specs,.cutoff→cutoff. Passing an old dotted name now triggers an informative error naming the renamed argument and its replacement (ADR-0006). -
compute_mpi()now uses a newdeprived()helper for inline deprivation cutoffs. The previous.deprivation_profilelist workflow is available via the newcompute_mpi_from_profile(). -
define_deprivation()replaces the boolean.collapseargument with.collapse_fn— pass a function (e.g.max) instead ofTRUE. -
save_mpi()now delegates Excel formatting to thetsgpackage. The.formatted_outputand.include_table_summaryarguments have been removed. - Default
.names_separatorindefine_mpi_specs()changed from">"to"__". -
.mpi_specsis now required indefine_deprivation(),compute_mpi_from_profile(), andsave_mpi(). ThegetOption("mpi_specs")default has been removed — pass the result ofdefine_mpi_specs()orglobal_mpi_specs()explicitly. -
use_global_mpi_specs()is deprecated. Useglobal_mpi_specs()instead. -
.save_as_global_optionsindefine_mpi_specs()is deprecated and no longer has any effect. - Minimum R version bumped to 4.1.0.
New features
-
compute_mpi()— single-call API with inlinedeprived()cutoffs and abyargument for disaggregation. -
compute_mpi_from_profile()— lower-level entry point for pre-assembled deprivation profiles (replaces the oldcompute_mpi()signature). -
deprived()— captures a bare cutoff expression and optional per-indicator settings (collapse_fn,set_na_equal_to;.datais unchanged). -
global_mpi_specs()— loads the built-in Global MPI specification. Replacesuse_global_mpi_specs(). -
compute_mpi()returns an object of classmpi_output. - Survey-weighted MPI via
weight,strata,cluster,fpcor a pre-builtsurvey::svydesign()object (survey_design) in bothcompute_mpi()andcompute_mpi_from_profile(). Thesurveypackage is a soft dependency (Suggests). -
inference = TRUEappends design-based standard errors and confidence intervals as*_se,*_ci_low,*_ci_highcolumns. Confidence level configurable viaci_level(default 0.95).
Improvements
- Internal computation refactored to use
dplyr::across()throughout, removing deprecatedsummarise_at()/mutate_at()/rename_all()calls. -
compute_headcount_ratio_adjusted()correctly preserves...grouping variables whenaggregationis also supplied (bug fix). -
tsg::rename_label()replaces manualattr(..., "label") <-assignments for column labels.
mpindex 0.2.1
CRAN release: 2024-01-09
- Changed returned value of
define_mpi_specsfrom list to data frame with a class ofmpi_specs_df. By default, it stores a global option namedmpi_specswhich can be accessed usinggetOption('mpi_specs'). Other specifications are now stored asattributes. - Changed default value of
.unit_of_analysisfromhouseholdstoNULL. -
save_mpinow allows unformatted output (tidy format) when generating an output. - Implemented feature to include MPI specification in the output by setting
.include_specstotTRUEinsave_mpi. - Deprecated
.names_separatorargument indefine_mpi_specs. - Enhancement of
define_deprivationbased on #17. - Added
use_global_mpi_specs()wrapper function to use Global MPI specification.