Skip to content

Commit

Permalink
update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 3, 2024
1 parent 70c45c8 commit c3c1811
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion R/p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,18 @@ p_significance.lm <- function(x, threshold = "default", ci = 0.95, verbose = TRU

#' @export
print.p_significance_lm <- function(x, digits = 2, p_digits = 3, ...) {
threshold <- attributes(x)$threshold
# make sure it's numeric
if (!is.numeric(threshold)) {
threshold <- 0.1
}
# make sure we have both bounds for the range
if (length(threshold) == 1) {
threshold <- c(threshold * -1, threshold)
}
caption <- sprintf(
"Practical Significance (threshold: %s)",
insight::format_value(attributes(x)$threshold, digits = 2)
paste(insight::format_value(threshold, digits = 2), collapse = ", ")

Check warning on line 103 in R/p_significance.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/p_significance.R,line=103,col=5,[paste_linter] toString(.) is more expressive than paste(., collapse = ", "). Note also glue::glue_collapse() and and::and() for constructing human-readable / translation-friendly lists
)
x$ps <- insight::format_p(x$ps, name = "ps", digits = p_digits)
x <- insight::format_table(x, digits = digits, p_digits = p_digits)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/p_significance.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Code
print(x)
Output
Practical Significance (threshold: default)
Practical Significance (threshold: -0.10, 0.10)
Parameter | 95% CI | ps
-----------------------------------------
Expand Down

0 comments on commit c3c1811

Please sign in to comment.