Skip to content

Commit

Permalink
removing options(warn = -1); fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
thegargiulian committed Mar 2, 2024
1 parent fa870cf commit 2016a4b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 0 additions & 2 deletions R/estimate_mse.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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

Expand Down
5 changes: 5 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,8 @@ citar
Entrada
et
magrittr
Convivencia
Esclarecimiento
Jurisdicción
Paz
repetición
12 changes: 7 additions & 5 deletions tests/testthat/test-combine_estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 2016a4b

Please sign in to comment.