From ac866856127324f3cf814e17cf5acb9c317a5581 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 4 Aug 2024 00:41:08 +0200 Subject: [PATCH] snaps --- DESCRIPTION | 2 +- R/check_dag.R | 16 ++++++++-------- tests/testthat/_snaps/check_dag.md | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index caf34bded..f29707608 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: performance Title: Assessment of Regression Models Performance -Version: 0.12.2.2 +Version: 0.12.2.3 Authors@R: c(person(given = "Daniel", family = "Lüdecke", diff --git a/R/check_dag.R b/R/check_dag.R index 215f5f89d..5b11ec7f3 100644 --- a/R/check_dag.R +++ b/R/check_dag.R @@ -238,10 +238,10 @@ print.check_dag <- function(x, ...) { insight::color_text("Model is correctly specified.", "green"), exposure_outcome_text, "\n\nNo adjustment needed to estimate the ", i, " effect of ", - datawizard::text_concatenate(attributes(x)$exposure), - " on ", + datawizard::text_concatenate(attributes(x)$exposure, enclose = "`"), + " on `", attributes(x)$outcome, - "." + "`." ) } else if (isTRUE(out$incorrectly_adjusted)) { # Scenario 2: incorrectly adjusted, adjustments where none is allowed @@ -250,8 +250,8 @@ print.check_dag <- function(x, ...) { exposure_outcome_text, "\n\nTo estimate the ", i, " effect, do ", insight::color_text("not", "italic"), - " adjust for: ", - datawizard::text_concatenate(out$current_adjustments), + " adjust for ", + datawizard::text_concatenate(out$current_adjustments, enclose = "`"), "." ) } else if (length(out$current_adjustments) != length(out$minimal_adjustment)) { @@ -261,8 +261,8 @@ print.check_dag <- function(x, ...) { exposure_outcome_text, "\n\nTo estimate the ", i, " effect, ", insight::color_text("also", "italic"), - " adjust for: ", - insight::color_text(datawizard::text_concatenate(out$minimal_adjustments), "yellow"), + " adjust for ", + insight::color_text(datawizard::text_concatenate(out$minimal_adjustments, enclose = "`"), "yellow"), "." ) if (is.null(out$current_adjustments)) { @@ -270,7 +270,7 @@ print.check_dag <- function(x, ...) { } else { msg <- paste0( msg, "\nCurrently, the model currently only adjusts for ", - insight::color_text(datawizard::text_concatenate(out$current_adjustments), "yellow"), "." + insight::color_text(datawizard::text_concatenate(out$current_adjustments, enclose = "`"), "yellow"), "." ) } } else { diff --git a/tests/testthat/_snaps/check_dag.md b/tests/testthat/_snaps/check_dag.md index a3c38cb1a..e28c825c3 100644 --- a/tests/testthat/_snaps/check_dag.md +++ b/tests/testthat/_snaps/check_dag.md @@ -9,7 +9,7 @@ - Outcome: y - Exposure: x - No adjustment needed to estimate the direct effect of x on y. + No adjustment needed to estimate the direct effect of `x` on `y`. # Correct adjustments for identifying total effects @@ -17,7 +17,7 @@ - Outcome: y - Exposure: x - No adjustment needed to estimate the total effect of x on y. + No adjustment needed to estimate the total effect of `x` on `y`. --- @@ -53,7 +53,7 @@ - Outcome: y - Exposure: x - To estimate the direct effect, also adjust for: b. + To estimate the direct effect, also adjust for `b`. Currently, the model does not adjust for any variables. # Correct adjustments for identifying total effects @@ -62,7 +62,7 @@ - Outcome: y - Exposure: x - To estimate the total effect, also adjust for: b. + To estimate the total effect, also adjust for `b`. Currently, the model does not adjust for any variables. @@ -77,8 +77,8 @@ - Outcome: y - Exposure: x - To estimate the direct effect, also adjust for: b and c. - Currently, the model currently only adjusts for c. + To estimate the direct effect, also adjust for `b` and `c`. + Currently, the model currently only adjusts for `c`. # Correct adjustments for identifying total effects @@ -86,7 +86,7 @@ - Outcome: y - Exposure: x - To estimate the total effect, also adjust for: b and c. - Currently, the model currently only adjusts for c. + To estimate the total effect, also adjust for `b` and `c`. + Currently, the model currently only adjusts for `c`.