From 8ceb53056b60e6a60992ebdfa48ec24f3d1d9fbf Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 24 Jun 2024 09:30:43 +0200 Subject: [PATCH] lintr --- R/utils.R | 2 +- R/utils_ci.R | 14 +++++++------- R/utils_interpret.R | 2 +- R/utils_validate_input_data.R | 5 ++--- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/R/utils.R b/R/utils.R index 4e64489ff..b5a2e247b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,5 +1,5 @@ #' @keywords internal -".someattributes<-" <- function(x, value) { +`.someattributes<-` <- function(x, value) { for (a in names(value)) { attr(x, a) <- value[[a]] } diff --git a/R/utils_ci.R b/R/utils_ci.R index 9f36db721..5cfe2f7d8 100644 --- a/R/utils_ci.R +++ b/R/utils_ci.R @@ -15,8 +15,8 @@ ncp <- suppressWarnings(stats::optim( par = 1.1 * rep(lambda, 2), fn = function(x) { - q <- stats::qf(p = probs, df, df_error, ncp = x) - sum(abs(q - f)) + quan <- stats::qf(p = probs, df, df_error, ncp = x) + sum(abs(quan - f)) }, control = list(abstol = 1e-09) )) @@ -45,8 +45,8 @@ ncp <- suppressWarnings(stats::optim( par = 1.1 * rep(t, 2), fn = function(x) { - q <- stats::qt(p = probs, df = df_error, ncp = x) - sum(abs(q - t)) + quan <- stats::qt(p = probs, df = df_error, ncp = x) + sum(abs(quan - t)) }, control = list(abstol = 1e-09) )) @@ -68,8 +68,8 @@ ncp <- suppressWarnings(stats::optim( par = 1.1 * rep(chisq, 2), fn = function(x) { - q <- stats::qchisq(p = probs, df, ncp = x) - sum(abs(q - chisq)) + quan <- stats::qchisq(p = probs, df, ncp = x) + sum(abs(quan - chisq)) }, control = list(abstol = 1e-09) )) @@ -100,7 +100,7 @@ ci > 1) { insight::format_error("ci must be a single numeric value between (0, 1)") } - return(TRUE) + TRUE } #' @keywords internal diff --git a/R/utils_interpret.R b/R/utils_interpret.R index 4633b85b5..1cb251314 100644 --- a/R/utils_interpret.R +++ b/R/utils_interpret.R @@ -15,5 +15,5 @@ ) } - return(choices[[rule]]) + choices[[rule]] } diff --git a/R/utils_validate_input_data.R b/R/utils_validate_input_data.R index 089d702ac..43f37c7ba 100644 --- a/R/utils_validate_input_data.R +++ b/R/utils_validate_input_data.R @@ -254,8 +254,7 @@ wide = TRUE, allow_ordered = FALSE, verbose = TRUE, ...) { if (inherits(x, "formula")) { - if (length(x) != 3L || - x[[3L]][[1L]] != as.name("|")) { + if (length(x) != 3L || x[[3L]][[1L]] != as.name("|")) { insight::format_error("Formula must have the 'x ~ groups | blocks'.") } @@ -323,7 +322,7 @@ verbose = TRUE, ...) { if (inherits(x, "formula")) { if (length(x) != 3L || length(x[[3]]) != 1L) { - insight::format_error("Formula must have the form of 'DV1 + ... + DVk ~ group', with exactly one term on the RHS.") + insight::format_error("Formula must have the form of 'DV1 + ... + DVk ~ group', with exactly one term on the RHS.") # nolint } data <- .resolve_formula(stats::reformulate(as.character(x)[3:2]), data, ...)