Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 24, 2024
1 parent b6b0039 commit 8ceb530
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @keywords internal
".someattributes<-" <- function(x, value) {
`.someattributes<-` <- function(x, value) {
for (a in names(value)) {
attr(x, a) <- value[[a]]
}
Expand Down
14 changes: 7 additions & 7 deletions R/utils_ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
))
Expand Down Expand Up @@ -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)
))
Expand All @@ -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)
))
Expand Down Expand Up @@ -100,7 +100,7 @@
ci > 1) {
insight::format_error("ci must be a single numeric value between (0, 1)")
}
return(TRUE)
TRUE
}

#' @keywords internal
Expand Down
2 changes: 1 addition & 1 deletion R/utils_interpret.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
)
}

return(choices[[rule]])
choices[[rule]]
}
5 changes: 2 additions & 3 deletions R/utils_validate_input_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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'.")
}

Expand Down Expand Up @@ -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, ...)
Expand Down

0 comments on commit 8ceb530

Please sign in to comment.