Skip to content

Commit 6dc729b

Browse files
committed
address lintr
1 parent 398b541 commit 6dc729b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

R/extract_parameters.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,9 @@
780780
isTRUE(test == "all") && (!is.null(standardize) || insight::is_multivariate(model))
781781
) {
782782
exception_type <- ifelse(
783-
!is.null(standardize),
783+
is.null(standardize),
784+
"for multivariate models",
784785
"when standardizing",
785-
"for multivariate models"
786786
)
787787
insight::format_error(
788788
sprintf("`test = \"all\"` is not supported %s;", exception_type),
@@ -1105,8 +1105,8 @@
11051105
.NA_inferential_cols <- function(pr) {
11061106
# For models where the response is NOT standardized, the (Intercept) is set
11071107
# to NA and so we also need to set all inferential statistics to NA
1108-
coef_name <- colnames(pr)[grepl("^Std_", colnames(pr))]
1109-
rows_to_NA <- pr$Parameter %in% "(Intercept)" | is.na(pr[[coef_name]])
1108+
coef_name <- colnames(pr)[startsWith(colnames(pr), "Std_")]
1109+
rows_to_NA <- pr$Parameter == "(Intercept)" | is.na(pr[[coef_name]])
11101110
if (any(rows_to_NA)) {
11111111
# fmt: skip
11121112
cols_not_to_NA <- c(".id", "Parameter", "Component", "Response", "Effects", "Group",

tests/testthat/test-standardize_parameters.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ test_that("standardize_parameters (with functions / interactions)", {
176176
)
177177
expect_equal(
178178
standardize_parameters(m3, method = "basic")$Std_Coefficient,
179-
model_parameters(m4)$Coefficient
179+
model_parameters(m4)$Coefficient,
180+
tolerance = 0.0001
180181
)
181182

182183
# transformed resp or pred should not affect

0 commit comments

Comments
 (0)