From 2016a4b26cfdc7a081beccd1da47d62024651a89 Mon Sep 17 00:00:00 2001 From: Maria Gargiulo Date: Sat, 2 Mar 2024 22:41:42 +0100 Subject: [PATCH] removing options(warn = -1); fixes #38 --- R/estimate_mse.R | 2 -- inst/WORDLIST | 5 +++++ tests/testthat/test-combine_estimates.R | 12 +++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/R/estimate_mse.R b/R/estimate_mse.R index ae2cb07..c37a1e9 100644 --- a/R/estimate_mse.R +++ b/R/estimate_mse.R @@ -119,7 +119,6 @@ run_lcmcr <- function(stratum_data_prepped, stratum_name, min_n = 1, ~factor(.x, levels = c(0, 1)))) %>% as.data.frame() - options(warn = -1) sampler <- lcmCR(captures = stratum_data_prepped, K = K, tabular = FALSE, @@ -135,7 +134,6 @@ run_lcmcr <- function(stratum_data_prepped, stratum_name, min_n = 1, samples = n_samples, thinning = posterior_thinning, output = FALSE) - options(warn = 0) N <- N[seq(1, length(N), n_samples / 1000)] # thin again diff --git a/inst/WORDLIST b/inst/WORDLIST index d095035..4d2be42 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -351,3 +351,8 @@ citar Entrada et magrittr +Convivencia +Esclarecimiento +Jurisdicción +Paz +repetición diff --git a/tests/testthat/test-combine_estimates.R b/tests/testthat/test-combine_estimates.R index b1952f2..8863038 100644 --- a/tests/testthat/test-combine_estimates.R +++ b/tests/testthat/test-combine_estimates.R @@ -54,13 +54,15 @@ estimates <- map_dfr(.x = estimates_files, testthat::test_that("Testing estimate done using only one replicate", { - testthat::expect_warning(estimates %>% filter(replicate == "R1") %>% - combine_estimates(.)) + testthat::expect_warning(estimates %>% + filter(replicate == "R1") %>% + combine_estimates(.)) - options(warn = -1) - r1 <- estimates %>% filter(replicate == "R1") %>% + suppressWarnings({ + r1 <- estimates %>% + filter(replicate == "R1") %>% combine_estimates(.) - options(warn = 0) + }) testthat::expect_equal(nrow(r1), 1) testthat::expect_named(r1, c("N_025", "N_mean", "N_975"))