Skip to content

Commit

Permalink
lint, style
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennebacher committed Oct 7, 2024
1 parent 6a0eccb commit 020668c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions R/describe_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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_))
}
}
)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-describe_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit 020668c

Please sign in to comment.