==3195824== Memcheck, a memory error detector ==3195824== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. ==3195824== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info ==3195824== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==3195824== R Under development (unstable) (2026-01-15 r89304) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "RSTr" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('RSTr') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("add_neighbors") > ### * add_neighbors > > flush(stderr()); flush(stdout()) > > ### Name: add_neighbors > ### Title: Add neighbors to adjacency information > ### Aliases: add_neighbors > > ### ** Examples > > mamap <- sf::st_as_sf(mamap[order(mamap$GEOID), ]) > ma_adj <- spdep::poly2nb(mamap) Warning in spdep::poly2nb(mamap) : some observations have no neighbours; if this seems unexpected, try increasing the snap argument. Warning in spdep::poly2nb(mamap) : neighbour object has 3 sub-graphs; if this sub-graph count seems unexpected, try increasing the snap argument. > new_neighs <- c(1, 4, 10) # attach regions 1, 4, and 10 > ma_adj <- add_neighbors(ma_adj, new_neighs) > > # Add neighbors by FIPS code instead of index > ma_adj <- suppressWarnings(spdep::poly2nb(mamap)) > names(ma_adj) <- mamap$GEOID > ma_adj <- add_neighbors(ma_adj, neighs = c("25001", "25007", "25019")) > > ma_adj <- suppressWarnings(spdep::poly2nb(mamap)) > ma_adj <- add_neighbors(ma_adj, c(1, 4)) # only attach 1 and 4 > ma_adj <- add_neighbors(ma_adj, c(4, 10)) # only attach 4 and 10 > > > > cleanEx() > nameEx("age_standardize") > ### * age_standardize > > flush(stderr()); flush(stdout()) > > ### Name: age_standardize > ### Title: Age-standardize model objects > ### Aliases: age_standardize > > ### ** Examples > > std_pop <- c(113154, 100640, 95799) > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) ==3195824== Invalid read of size 8 ==3195824== at 0x184D8C7B: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:64) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== by 0x4F408D: R_execClosure (svn/R-devel/src/main/eval.c:2389) ==3195824== by 0x4F4D46: applyClosure_core (svn/R-devel/src/main/eval.c:2302) ==3195824== by 0x4F5738: Rf_applyClosure (svn/R-devel/src/main/eval.c:2324) ==3195824== by 0x53D0AB: dispatchMethod (svn/R-devel/src/main/objects.c:473) ==3195824== by 0x53D710: Rf_usemethod (svn/R-devel/src/main/objects.c:513) ==3195824== by 0x53D942: do_usemethod (svn/R-devel/src/main/objects.c:579) ==3195824== Address 0x56b701f0 is 48 bytes inside a block of size 192 free'd ==3195824== at 0x4846B83: free (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:989) ==3195824== by 0x532865: ReleaseLargeFreeVectors (svn/R-devel/src/main/memory.c:1167) ==3195824== by 0x532865: RunGenCollect (svn/R-devel/src/main/memory.c:1951) ==3195824== by 0x532865: R_gc_internal (svn/R-devel/src/main/memory.c:3237) ==3195824== by 0x534E7E: Rf_cons (svn/R-devel/src/main/memory.c:2488) ==3195824== by 0x177E29FA: Rcpp::Rcpp_precious_preserve(SEXPREC*) (/tmp/RtmpSPo0Di/R.INSTALL2915155ad529f3/Rcpp/src/barrier.cpp:115) ==3195824== by 0x184B37F0: Rcpp_precious_preserve (R-devel/site-library/Rcpp/include/Rcpp/routines.h:155) ==3195824== by 0x184B37F0: Rcpp_PreciousPreserve (R-devel/site-library/Rcpp/include/RcppCommon.h:119) ==3195824== by 0x184B37F0: set__ (R-devel/site-library/Rcpp/include/Rcpp/storage/PreserveStorage.h:43) ==3195824== by 0x184B37F0: Vector (R-devel/site-library/Rcpp/include/Rcpp/vector/Vector.h:73) ==3195824== by 0x184B37F0: Exporter (R-devel/site-library/Rcpp/include/Rcpp/internal/Exporter.h:31) ==3195824== by 0x184B37F0: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:86) ==3195824== by 0x184B37F0: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184B37F0: operator Rcpp::Vector<13> > (R-devel/site-library/Rcpp/include/Rcpp/api/meat/proxy.h:40) ==3195824== by 0x184B37F0: Rcpp::traits::Exporter >::get() (R-devel/site-library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloAs.h:468) ==3195824== by 0x184CDD92: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:88) ==3195824== by 0x184CDD92: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184CDD92: Rcpp::internal::generic_name_proxy<19, Rcpp::PreserveStorage>::operator arma::Cube >() const (R-devel/site-library/Rcpp/include/Rcpp/vector/proxy.h:173) ==3195824== by 0x184D77C9: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:46) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== Block was alloc'd at ==3195824== at 0x4843866: malloc (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:446) ==3195824== by 0x536901: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2894) ==3195824== by 0x46C79A: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:609) ==3195824== by 0x46C79A: coerceToReal (svn/R-devel/src/main/coerce.c:564) ==3195824== by 0x46C79A: Rf_coerceVector (svn/R-devel/src/main/coerce.c:1289) ==3195824== by 0x184CDD11: r_true_cast<14> (R-devel/site-library/Rcpp/include/Rcpp/r_cast.h:90) ==3195824== by 0x184CDD11: r_cast<14> (R-devel/site-library/Rcpp/include/Rcpp/r_cast.h:170) ==3195824== by 0x184CDD11: Vector (R-devel/site-library/Rcpp/include/Rcpp/vector/Vector.h:73) ==3195824== by 0x184CDD11: Exporter (R-devel/site-library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloAs.h:465) ==3195824== by 0x184CDD11: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:86) ==3195824== by 0x184CDD11: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184CDD11: Rcpp::internal::generic_name_proxy<19, Rcpp::PreserveStorage>::operator arma::Cube >() const (R-devel/site-library/Rcpp/include/Rcpp/vector/proxy.h:173) ==3195824== by 0x184D7586: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:43) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== by 0x4F408D: R_execClosure (svn/R-devel/src/main/eval.c:2389) ==3195824== by 0x4F4D46: applyClosure_core (svn/R-devel/src/main/eval.c:2302) ==3195824== ==3195824== Invalid read of size 8 ==3195824== at 0x184D8CEA: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:65) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== by 0x4F408D: R_execClosure (svn/R-devel/src/main/eval.c:2389) ==3195824== by 0x4F4D46: applyClosure_core (svn/R-devel/src/main/eval.c:2302) ==3195824== by 0x4F5738: Rf_applyClosure (svn/R-devel/src/main/eval.c:2324) ==3195824== by 0x53D0AB: dispatchMethod (svn/R-devel/src/main/objects.c:473) ==3195824== by 0x53D710: Rf_usemethod (svn/R-devel/src/main/objects.c:513) ==3195824== by 0x53D942: do_usemethod (svn/R-devel/src/main/objects.c:579) ==3195824== Address 0x554433d0 is 48 bytes inside a block of size 192 free'd ==3195824== at 0x4846B83: free (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:989) ==3195824== by 0x532865: ReleaseLargeFreeVectors (svn/R-devel/src/main/memory.c:1167) ==3195824== by 0x532865: RunGenCollect (svn/R-devel/src/main/memory.c:1951) ==3195824== by 0x532865: R_gc_internal (svn/R-devel/src/main/memory.c:3237) ==3195824== by 0x534E7E: Rf_cons (svn/R-devel/src/main/memory.c:2488) ==3195824== by 0x177E29FA: Rcpp::Rcpp_precious_preserve(SEXPREC*) (/tmp/RtmpSPo0Di/R.INSTALL2915155ad529f3/Rcpp/src/barrier.cpp:115) ==3195824== by 0x184B37F0: Rcpp_precious_preserve (R-devel/site-library/Rcpp/include/Rcpp/routines.h:155) ==3195824== by 0x184B37F0: Rcpp_PreciousPreserve (R-devel/site-library/Rcpp/include/RcppCommon.h:119) ==3195824== by 0x184B37F0: set__ (R-devel/site-library/Rcpp/include/Rcpp/storage/PreserveStorage.h:43) ==3195824== by 0x184B37F0: Vector (R-devel/site-library/Rcpp/include/Rcpp/vector/Vector.h:73) ==3195824== by 0x184B37F0: Exporter (R-devel/site-library/Rcpp/include/Rcpp/internal/Exporter.h:31) ==3195824== by 0x184B37F0: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:86) ==3195824== by 0x184B37F0: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184B37F0: operator Rcpp::Vector<13> > (R-devel/site-library/Rcpp/include/Rcpp/api/meat/proxy.h:40) ==3195824== by 0x184B37F0: Rcpp::traits::Exporter >::get() (R-devel/site-library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloAs.h:468) ==3195824== by 0x184CDD92: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:88) ==3195824== by 0x184CDD92: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184CDD92: Rcpp::internal::generic_name_proxy<19, Rcpp::PreserveStorage>::operator arma::Cube >() const (R-devel/site-library/Rcpp/include/Rcpp/vector/proxy.h:173) ==3195824== by 0x184D77C9: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:46) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== Block was alloc'd at ==3195824== at 0x4843866: malloc (/builddir/build/BUILD/valgrind-3.24.0/coregrind/m_replacemalloc/vg_replace_malloc.c:446) ==3195824== by 0x536901: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2894) ==3195824== by 0x46C79A: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:609) ==3195824== by 0x46C79A: coerceToReal (svn/R-devel/src/main/coerce.c:564) ==3195824== by 0x46C79A: Rf_coerceVector (svn/R-devel/src/main/coerce.c:1289) ==3195824== by 0x184CDD11: r_true_cast<14> (R-devel/site-library/Rcpp/include/Rcpp/r_cast.h:90) ==3195824== by 0x184CDD11: r_cast<14> (R-devel/site-library/Rcpp/include/Rcpp/r_cast.h:170) ==3195824== by 0x184CDD11: Vector (R-devel/site-library/Rcpp/include/Rcpp/vector/Vector.h:73) ==3195824== by 0x184CDD11: Exporter (R-devel/site-library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloAs.h:465) ==3195824== by 0x184CDD11: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:86) ==3195824== by 0x184CDD11: as > (R-devel/site-library/Rcpp/include/Rcpp/as.h:151) ==3195824== by 0x184CDD11: Rcpp::internal::generic_name_proxy<19, Rcpp::PreserveStorage>::operator arma::Cube >() const (R-devel/site-library/Rcpp/include/Rcpp/vector/proxy.h:173) ==3195824== by 0x184D763B: update_lambda(Rcpp::Vector<19, Rcpp::PreserveStorage>&) (packages/tests-vg/RSTr/src/update_lambda.cpp:44) ==3195824== by 0x184A5334: _RSTr_update_lambda (packages/tests-vg/RSTr/src/RcppExports.cpp:100) ==3195824== by 0x4A7E3D: R_doDotCall (svn/R-devel/src/main/dotcode.c:754) ==3195824== by 0x4E1E83: bcEval_loop (svn/R-devel/src/main/eval.c:8682) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7515) ==3195824== by 0x4F1FD7: bcEval (svn/R-devel/src/main/eval.c:7500) ==3195824== by 0x4F230A: Rf_eval (svn/R-devel/src/main/eval.c:1167) ==3195824== by 0x4F408D: R_execClosure (svn/R-devel/src/main/eval.c:2389) ==3195824== by 0x4F4D46: applyClosure_core (svn/R-devel/src/main/eval.c:2302) ==3195824== > # age-standardize by all age groups > mod_mst <- age_standardize(mod_mst, std_pop, "35-64") > # Add onto age-standardized estimates. Age-standardize only by the first two age groups > mod_mst <- age_standardize(mod_mst, std_pop[1:2], "35-54", groups = 1:2) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("aggregate_count") > ### * aggregate_count > > flush(stderr()); flush(stdout()) > > ### Name: aggregate_count > ### Title: Aggregate count arrays > ### Aliases: aggregate_count > > ### ** Examples > > margin_time <- 3 > # aggregate population from all years for each county-group > pop_7988 <- aggregate_count(miheart$n, margin_time) > # aggregate population from 1980-1984 for each county-group > pop_8084 <- aggregate_count(miheart$n, margin_time, groups = as.character(1980:1984)) > # bind aggregated pop from all years to population data > pop_agg <- aggregate_count(miheart$n, margin_time, bind_new = TRUE, new_name = "1979-1988") > > > > cleanEx() > nameEx("aggregate_samples") > ### * aggregate_samples > > flush(stderr()); flush(stdout()) > > ### Name: aggregate_samples > ### Title: Aggregate samples by non-age group > ### Aliases: aggregate_samples > > ### ** Examples > > pop <- miheart$n[1:2, 1:3, 1:3] > time_margin <- 3 > # calculate prevalence by aggregating over time periods > samples_3564 <- aggregate_samples(minsample, pop, margin = time_margin) > # calculate prevalence of only the first two time periods > samples_3554 <- aggregate_samples(minsample, pop, time_margin, groups = 1:2) > # bind prevalence samples to original samples > samples_prev <- aggregate_samples( + minsample, + pop, + time_margin, + bind_new = TRUE, + new_name = "1979-1981" + ) > > > > cleanEx() > nameEx("car") > ### * car > > flush(stderr()); flush(stdout()) > > ### Name: car > ### Title: Create CAR model > ### Aliases: car rcar mcar mstcar > > ### ** Examples > > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > # MSTCAR model > mod_mst <- mstcar( + name = "test", + data = data_min, + adjacency = adj_min, + dir = tempdir(), + show_plots = FALSE, + verbose = FALSE + ) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("get_estimates") > ### * get_estimates > > flush(stderr()); flush(stdout()) > > ### Name: get_estimates > ### Title: Extract estimates from RSTr model object > ### Aliases: get_estimates > > ### ** Examples > > std_pop <- c(113154, 100640, 95799) > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) > estimates_table <- get_estimates(mod_mst) > mod_mst <- age_standardize(mod_mst, std_pop, "35-64") > estimates_table_as <- get_estimates(mod_mst) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("get_medians") > ### * get_medians > > flush(stderr()); flush(stdout()) > > ### Name: get_medians > ### Title: Generate medians, credible intervals, and relative precisions > ### Aliases: get_medians get_credible_interval get_relative_precision > > ### ** Examples > > minmedians <- get_medians(minsample) > minci <- get_credible_interval(minsample) > # Reducing perc_ci narrows the credible interval > minci_75 <- get_credible_interval(minsample, perc_ci = 0.75) > # low relative precision due to small data size > minrp <- get_relative_precision(minmedians, minci) > # reducing CI increases relative precision > minrp_75 <- get_relative_precision(minmedians, minci_75) > # find estimates with low relative precision > low_rp <- minrp_75 < 1 > > > > cleanEx() > nameEx("load_model") > ### * load_model > > flush(stderr()); flush(stdout()) > > ### Name: load_model > ### Title: Load model > ### Aliases: load_model > > ### ** Examples > > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) > mod_mst <- load_model(name = "test", dir = tempdir()) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("load_samples") > ### * load_samples > > flush(stderr()); flush(stdout()) > > ### Name: load_samples > ### Title: Load MCMC samples > ### Aliases: load_samples > > ### ** Examples > > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) > samples <- load_samples(mod_mst) * 1e5 > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("long_to_list_matrix") > ### * long_to_list_matrix > > flush(stderr()); flush(stdout()) > > ### Name: long_to_list_matrix > ### Title: Generate count data for RSTr object > ### Aliases: long_to_list_matrix > > ### ** Examples > > ma_data <- maexample[!is.na(maexample$Year), ] > # Generates data from 1979-1981 stratified by sex > ma_data_mst <- long_to_list_matrix(ma_data, Deaths, Population, County.Code, Sex.Code, Year.Code) > ma_data_79 <- ma_data[ma_data$Year == 1979, ] > # Generates 1979 data stratified by sex > ma_data_m <- long_to_list_matrix(ma_data_79, Deaths, Population, County.Code, Sex.Code) > # Generates 1979 data summarized for all sexes > ma_data_u <- long_to_list_matrix(ma_data_79, Deaths, Population, County.Code) > > > > cleanEx() > nameEx("standardize_samples") > ### * standardize_samples > > flush(stderr()); flush(stdout()) > > ### Name: standardize_samples > ### Title: Age-standardize samples > ### Aliases: standardize_samples > > ### ** Examples > > std_pop <- c(113154, 100640, 95799) > age_margin <- 2 > # age-standardize by all age groups > samples_3564 <- standardize_samples(minsample, std_pop, age_margin) > # age-standardize only by the first two age groups > samples_3554 <- standardize_samples(minsample, std_pop[1:2], age_margin, groups = 1:2) > # bind age-standardized samples to original samples > samples_as <- standardize_samples( + minsample, + std_pop, + age_margin, + bind_new = TRUE, + new_name = "35-64" + ) > > > > cleanEx() > nameEx("suppress_estimates") > ### * suppress_estimates > > flush(stderr()); flush(stdout()) > > ### Name: suppress_estimates > ### Title: Suppress estimates based on reliability criteria > ### Aliases: suppress_estimates > > ### ** Examples > > std_pop <- c(113154, 100640, 95799) > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) > mod_mst <- suppress_estimates(mod_mst, threshold = 1000, type = "population") > estimates_table <- get_estimates(mod_mst) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > cleanEx() > nameEx("update_model") > ### * update_model > > flush(stderr()); flush(stdout()) > > ### Name: update_model > ### Title: Update model > ### Aliases: update_model > > ### ** Examples > > data_min <- lapply(miheart, \(x) x[1:2, 1:3, 1:3]) > adj_min <- list(2, 1) > mod_mst <- mstcar("test", data_min, adj_min, tempdir(), show_plots = FALSE, verbose = FALSE) > mod_mst <- update_model(mod_mst, iterations = 1000, show_plots = FALSE, verbose = FALSE) > ## Don't show: > unlink(paste0(tempdir(), "\\test"), recursive = TRUE) > ## End(Don't show) > > > > ### *