Skip to content

Commit

Permalink
lintrs, spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Mar 18, 2024
1 parent 54327de commit 4127d9d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions R/check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ check_overdispersion.performance_simres <- function(x, alternative = c("two.side

# check for special arguments - we may pass "object_name" from other methods
dots <- list(...)
if (!is.null(dots$object_name)) {
obj_name <- dots$object_name
} else {
if (is.null(dots$object_name)) {
obj_name <- insight::safe_deparse_symbol(substitute(x))
} else {
obj_name <- dots$object_name
}

# statistics function
Expand Down
2 changes: 1 addition & 1 deletion R/check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ check_predictions.default <- function(object,
minfo <- insight::model_info(object, verbose = FALSE)

# try to find sensible default for "type" argument
suggest_dots <- (minfo$is_bernoulli || minfo$is_count || minfo$is_ordinal || minfo$is_categorical || minfo$is_multinomial)
suggest_dots <- (minfo$is_bernoulli || minfo$is_count || minfo$is_ordinal || minfo$is_categorical || minfo$is_multinomial) # nolint
if (missing(type) && suggest_dots) {
type <- "discrete_interval"
}
Expand Down
2 changes: 1 addition & 1 deletion R/check_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' @details Uniformity of residuals is checked using a Kolmogorov-Smirnov test.
#' There is a `plot()` method to visualize the distribution of the residuals.
#' The test fpr uniformity basically tests to which extent the observed values
#' The test for uniformity basically tests to which extent the observed values
#' deviate from the model expectations (i.e. simulated values). In this sense,
#' the `check_residuals()` function has similar goals like [`check_predictions()`].
#'
Expand Down
12 changes: 6 additions & 6 deletions R/simulate_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ plot.performance_simres <- function(x, ...) {

.simres_statistics <- function(x, statistic_fun, alternative = "two.sided") {
# summarize the observed and simulated residuals
if (!is.null(statistic_fun)) {
# either apply a function to observed and simulated residusls,
if (is.null(statistic_fun)) {
# we pass the values to compute the p-value directly (for "check_outliers()")
observed <- x
simulated <- statistic_fun

Check warning on line 103 in R/simulate_residuals.R

View check run for this annotation

Codecov / codecov/patch

R/simulate_residuals.R#L102-L103

Added lines #L102 - L103 were not covered by tests
} else {
# or apply a function to observed and simulated residusls,
# to calcualte a summary statistic
observed <- statistic_fun(x$observedResponse)
simulated <- apply(x$simulatedResponse, 2, statistic_fun)
} else {
# or we pass the values to compute the p-value directly (for "check_outliers()")
observed <- x
simulated <- statistic_fun
}
# p is simply ratio of simulated zeros to observed zeros
p <- switch(alternative,
Expand Down
2 changes: 1 addition & 1 deletion man/check_residuals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4127d9d

Please sign in to comment.