From 020668c248c0dc8f2d24d74d5dae2a2623280499 Mon Sep 17 00:00:00 2001 From: etiennebacher Date: Mon, 7 Oct 2024 22:25:37 +0200 Subject: [PATCH] lint, style --- R/describe_distribution.R | 5 +++-- tests/testthat/test-describe_distribution.R | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/R/describe_distribution.R b/R/describe_distribution.R index b35672799..2e61c1dc3 100644 --- a/R/describe_distribution.R +++ b/R/describe_distribution.R @@ -186,7 +186,8 @@ describe_distribution.numeric <- function(x, # Confidence Intervals if (!is.null(ci)) { insight::check_if_installed("boot") - results <- tryCatch({ + results <- tryCatch( + { boot::boot( data = x, statistic = .boot_distribution, @@ -200,7 +201,7 @@ describe_distribution.numeric <- function(x, insight::format_warning( "When bootstrapping CIs, sample was too sparse to find TD. Returning NA for CIs." ) - return(list(t = c(NA_real_, NA_real_))) + list(t = c(NA_real_, NA_real_)) } } ) diff --git a/tests/testthat/test-describe_distribution.R b/tests/testthat/test-describe_distribution.R index eb2db30ea..34207f74b 100644 --- a/tests/testthat/test-describe_distribution.R +++ b/tests/testthat/test-describe_distribution.R @@ -292,9 +292,9 @@ test_that("describe_distribution formatting", { test_that("return NA in CI if sample is too sparse", { set.seed(123456) expect_warning( - res <- describe_distribution(mtcars[mtcars$cyl=="6",], wt, centrality = "map", ci = 0.95), + res <- describe_distribution(mtcars[mtcars$cyl == "6", ], wt, centrality = "map", ci = 0.95), #nolint "When bootstrapping CIs, sample was too sparse to find TD" ) expect_identical(res$CI_low, NA) - expect_identical(res$CI_high, NA) + expect_identical(res$CI_high, NA) })