Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare CRAN release #791

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.12.4.17
Version: 0.13.0
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -160,4 +160,3 @@ Config/Needs/website:
r-lib/pkgdown,
easystats/easystatstemplate
Config/rcmdcheck/ignore-inconsequential-notes: true
Remotes: easystats/see
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# performance 0.12.5
# performance 0.13.0

## Breaking changes

Expand Down
5 changes: 2 additions & 3 deletions R/binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@
#' # look at the data frame
#' as.data.frame(result)
#'
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' \donttest{
#' # plot
#' if (require("see")) {
#' plot(result, show_dots = TRUE)
#' }
#' plot(result, show_dots = TRUE)
#' }
#'
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
#' m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
#' check_collinearity(m)
#'
#' @examplesIf require("see")
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' # plot results
#' x <- check_collinearity(m)
#' plot(x)
Expand Down Expand Up @@ -407,7 +407,7 @@
}


.check_collinearity <- function(x, component, ci = 0.95, verbose = TRUE) {

Check warning on line 410 in R/check_collinearity.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/check_collinearity.R,line=410,col=1,[cyclocomp_linter] Reduce the cyclomatic complexity of this function from 44 to at most 40.

Check warning on line 410 in R/check_collinearity.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_collinearity.R,line=410,col=1,[cyclocomp_linter] Reduce the cyclomatic complexity of this function from 44 to at most 40.
v <- .safe(insight::get_varcov(x, component = component, verbose = FALSE))

# sanity check
Expand Down
2 changes: 1 addition & 1 deletion R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#' Interpreting Confounder and Modifier Coefficients. American Journal of
#' Epidemiology, 177(4), 292–298. \doi{10.1093/aje/kws412}
#'
#' @examplesIf require("ggdag", quietly = TRUE) && require("dagitty", quietly = TRUE) && require("see", quietly = TRUE)
#' @examplesIf all(insight::check_if_installed(c("ggdag", "dagitty", "see"), quietly = TRUE))
#' # no adjustment needed
#' check_dag(
#' y ~ x + b,
Expand Down
4 changes: 2 additions & 2 deletions R/check_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ NULL
#' There is a `plot()` method, which shows the probabilities of all predicted
#' distributions, however, only if the probability is greater than zero.
#'
#' @examplesIf require("lme4") && require("parameters") && require("randomForest")
#' @examplesIf all(insight::check_if_installed(c("lme4", "parameters", "randomForest"), quietly = TRUE))
#' data(sleepstudy, package = "lme4")
#' model <<- lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
#' check_distribution(model)
#'
#' @examplesIf require("see") && require("patchwork") && require("randomForest")
#' @examplesIf all(insight::check_if_installed(c("see", "patchwork", "randomForest"), quietly = TRUE))
#' plot(check_distribution(model))
#'
#' @export
Expand Down
7 changes: 3 additions & 4 deletions R/check_heteroscedasticity.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
#' check_heteroscedasticity(m)
#'
#' # plot results
#' if (require("see")) {
#' x <- check_heteroscedasticity(m)
#' plot(x)
#' }
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' x <- check_heteroscedasticity(m)
#' plot(x)
#' @export
check_heteroscedasticity <- function(x, ...) {
UseMethod("check_heteroscedasticity")
Expand All @@ -53,7 +52,7 @@
if (!info$is_linear) {
msg <- "This Breusch-Pagan Test currently only works Gaussian models."
if (info$is_count) {
paste0(msg, " You may check your model for overdispersion or zero-inflation instead (see 'check_overdispersion()' and 'check_zeroinflation()').")

Check warning on line 55 in R/check_heteroscedasticity.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/check_heteroscedasticity.R,line=55,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 151 characters.

Check warning on line 55 in R/check_heteroscedasticity.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=R/check_heteroscedasticity.R,line=55,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 151 characters.
}
insight::format_alert(msg)
return(NULL)
Expand Down
7 changes: 3 additions & 4 deletions R/check_homogeneity.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
#' check_homogeneity(model)
#'
#' # plot results
#' if (require("see")) {
#' result <- check_homogeneity(model)
#' plot(result)
#' }
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' result <- check_homogeneity(model)
#' plot(result)
#' @export
check_homogeneity <- function(x, method = c("bartlett", "fligner", "levene", "auto"), ...) {
UseMethod("check_homogeneity")
Expand Down
2 changes: 1 addition & 1 deletion R/check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' standardized deviance residuals is shown (in line with changes in
#' `plot.lm()` for R 4.3+).
#'
#' @examplesIf require("see")
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' m <<- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
#' check_normality(m)
#'
Expand Down
2 changes: 1 addition & 1 deletion R/check_outliers.R
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
#' group_iris <- datawizard::data_group(iris, "Species")
#' check_outliers(group_iris)
#' # nolint start
#' @examplesIf require("see") && require("bigutilsr") && require("loo") && require("MASS") && require("ICSOutlier") && require("ICS") && require("dbscan")
#' @examplesIf all(insight::check_if_installed(c("bigutilsr", "MASS", "ICSOutlier", "ICS", "dbscan", "loo", "see"), quietly = TRUE))
#' # nolint end
#' \donttest{
#' # You can also run all the methods
Expand Down
2 changes: 1 addition & 1 deletion R/check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#' - Gelman, A., Hill, J., and Vehtari, A. (2020). Regression and Other Stories.
#' Cambridge University Press.
#'
#' @examplesIf require("see")
#' @examplesIf insight::check_if_installed("see", minimum_version = "0.9.1", quietly = TRUE)
#' # linear model
#' model <- lm(mpg ~ disp, data = mtcars)
#' check_predictions(model)
Expand Down
7 changes: 3 additions & 4 deletions man/binned_residuals.Rd

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

2 changes: 1 addition & 1 deletion man/check_collinearity.Rd

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

2 changes: 1 addition & 1 deletion man/check_dag.Rd

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

4 changes: 2 additions & 2 deletions man/check_distribution.Rd

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

8 changes: 4 additions & 4 deletions man/check_heteroscedasticity.Rd

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

8 changes: 4 additions & 4 deletions man/check_homogeneity.Rd

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

2 changes: 1 addition & 1 deletion man/check_normality.Rd

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

2 changes: 1 addition & 1 deletion man/check_outliers.Rd

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

2 changes: 1 addition & 1 deletion man/check_predictions.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-check_model.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
skip_on_cran()
skip_if_not_installed("see")
skip_if_not_installed("see", minimum_version = "0.9.1")

d <- data.frame(
y = c(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ test_that("check_overdispersion, MASS::negbin", {
expect_message(capture.output(print(out)), "Underdispersion detected")

# check that plot works
skip_if_not_installed("see")
skip_if_not_installed("see", minimum_version = "0.9.1")
expect_s3_class(plot(out), "ggplot")
})

Expand Down
Loading