Skip to content

Commit ecfd6b8

Browse files
authored
Merge branch 'main' into fix/issue-851-check-model-theme-argument
2 parents 85a0715 + 319d229 commit ecfd6b8

76 files changed

Lines changed: 2087 additions & 1100 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
^logo.png
2-
^README.Rmd
3-
^LICENSE
4-
5-
^\.Rprofile$
6-
^.*\.Rproj$
7-
^\.Rproj\.user$
8-
9-
^\.travis.yml
10-
^\_pkgdown.yml
11-
^\_pkgdown.yaml
12-
^paper.bib$
13-
14-
^data/.
15-
^docs/.
16-
^vignettes/.
17-
^pkgdown/.
18-
^WIP/.
19-
^papers/.
20-
^.github/.
21-
^CODE_OF_CONDUCT\.md$
22-
^revdep$
23-
^tests/testthat/_snaps/.
24-
^cran-comments\.md$
25-
^\.github$
26-
\.code-workspace$
27-
\.lintr$
28-
^CRAN-SUBMISSION$
29-
^[.]?air[.]toml$
30-
^\.vscode$
1+
^logo.png
2+
^README.Rmd
3+
^LICENSE
4+
5+
^\.Rprofile$
6+
^.*\.Rproj$
7+
^\.Rproj\.user$
8+
9+
^\.travis.yml
10+
^\_pkgdown.yml
11+
^\_pkgdown.yaml
12+
^paper.bib$
13+
^GEMINI\.md$
14+
15+
^data/.
16+
^docs/.
17+
^vignettes/.
18+
^pkgdown/.
19+
^WIP/.
20+
^papers/.
21+
^.github/.
22+
^CODE_OF_CONDUCT\.md$
23+
^revdep$
24+
^tests/testthat/_snaps/.
25+
^cran-comments\.md$
26+
^\.github$
27+
\.code-workspace$
28+
\.lintr$
29+
^CRAN-SUBMISSION$
30+
^[.]?air[.]toml$
31+
^\.vscode$
32+
^\.positai$
33+
^\.claude$

.github/workflows/format-suggest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
pull-requests: write
2929

3030
steps:
31-
- uses: actions/checkout@v6
31+
- uses: actions/checkout@v7
3232
with:
3333
ref: ${{ github.event.pull_request.head.sha }}
3434

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ Network Trash Folder
5050
Temporary Items
5151
.apdisk
5252
.Rprofile
53+
.positai
54+
.vscode

DESCRIPTION

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: performance
33
Title: Assessment of Regression Models Performance
4-
Version: 0.15.3.2
4+
Version: 0.17.0.6
55
Authors@R:
66
c(person(given = "Daniel",
77
family = "Lüdecke",
@@ -73,9 +73,9 @@ BugReports: https://github.com/easystats/performance/issues
7373
Depends:
7474
R (>= 4.0)
7575
Imports:
76-
bayestestR (>= 0.17.0),
77-
insight (>= 1.4.4),
78-
datawizard (>= 1.3.0),
76+
bayestestR (>= 0.18.1),
77+
insight (>= 1.5.1),
78+
datawizard (>= 1.3.1),
7979
stats,
8080
methods,
8181
utils
@@ -150,7 +150,7 @@ Suggests:
150150
rstanarm,
151151
rstantools,
152152
sandwich,
153-
see (>= 0.9.0),
153+
see (>= 0.13.0),
154154
survey,
155155
survival,
156156
testthat (>= 3.2.1),
@@ -159,13 +159,12 @@ Suggests:
159159
withr (>= 3.0.0)
160160
Encoding: UTF-8
161161
Language: en-US
162-
RoxygenNote: 7.3.3
163162
Roxygen: list(markdown = TRUE)
164163
Config/testthat/edition: 3
165-
Config/testthat/parallel: true
164+
Config/testthat/parallel: false
166165
Config/Needs/website:
167166
rstudio/bslib,
168167
r-lib/pkgdown,
169168
easystats/easystatstemplate
170169
Config/rcmdcheck/ignore-inconsequential-notes: true
171-
Remotes: easystats/see
170+
Config/roxygen2/version: 8.0.0

GEMINI.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# R Project Coding Conventions for easystats
2+
3+
This document outlines the common coding conventions observed in the `easystats` R projects.
4+
5+
## File Naming
6+
7+
* Files are named with `snake_case` and should correspond to the main function they contain (e.g., `check_normality.R`).
8+
9+
## Package versioning
10+
11+
* Package versions follow Semantic Versioning conventions.
12+
13+
* If pull requests include user-visible changes, the "developer" version number should be increased (e.g. from 0.10.1.5 to 0.10.1.6). This ensures that `easystats::install_latest()` will download the latest versions.
14+
15+
* For the NEWS file, the current development version should not be indicated by a version number, but rather with `(devel)`.
16+
17+
## Code Style & Formatting
18+
19+
* **Assignment:** Use the `<-` operator for assignment, not `=`.
20+
* **Spacing:**
21+
* Use spaces around all infix operators (`<-`, `==`, `+`, etc.).
22+
* Place a space after a comma, but not before.
23+
* **Line Length:** Keep lines to a reasonable length (e.g., under 80-100 characters) to improve readability.
24+
25+
## Function Naming
26+
27+
* **Public Functions:** Use lower case, underscore separated if more than one verb, i.e. `snake_case` (e.g., `check_normality()`, `model_performance()`). These functions should be exported.
28+
* **Internal Functions:** Prefix with a dot (`.`) and may use `snake_case` or `camelCase` (e.g., `.safe()`, `.get_BIC()`, `.check_normality()`). These functions should not be exported.
29+
* **Naming**: Common prefix for functions that focus on specific "tasks" or workflows (e.g. in package "insight", `get_*()` to get data, `find_*()` to find information, or in package "performance", `performance_*()` to compute measures of model quality, `check_*()` to check model assumptions...).
30+
31+
## Argument names
32+
33+
* Lower case, underscore separated if more than one verb.
34+
* Arguments that refer to plot or table aesthetics (like size or alpha of geoms) should follow the pattern `aesthetics_geomtype`, e.g. `size_point`, `color_line` or `alpha_rope`.
35+
* "easystats" uses the argument name `by` to indicate grouping, not `group_by` or `at`.
36+
* Use `select` and `exclude` to select columns/variables, and `keep` or `drop` to select rows/observations.
37+
* Handling NA values, especially removing missing values, is done with `remove_na`.
38+
39+
## Element / Column names (for returned data frames)
40+
41+
1) First letter of the column name is capital, unless (6) applies (*example:* `Parameter`).
42+
2) First letter of nouns is capital, unless (6) applies (*example:* `ROPE_Percentage`, `Prior_Scale`).
43+
3) Using underscore rather than camelCase to separate words (*example:* `CI_high`).
44+
4) Multiple words: common/main part first and adjective/specifier/variational part after, unless (8) applies (*example:* `Median_standardized`, `ROPE_percentage`).
45+
5) Abbreviations: all uppercase (*example:* `ESS`, `MCSE`, `ROPE`).
46+
6) Keep conventions for reserved words (*example:* `p`, `pd`, `Rhat`).
47+
7) Adjectives / verbs: all lower case, unless (1) applies (*example:* `high` or `low` in `CI_high` or `CI_low`).
48+
8) In case of multiple occurrences of column names that indicate the same measure or content (like `CI_low` or `SE`), the common part is appended as suffix to the context specific part (*example:* `CI_low` and `Eta2_partial_CI_low`, and **not** `CI_low` and `CI_low_Eta2_partial`).
49+
9) The "squared" term in column names that refers to "common" statistics (`Eta2`, `Chi2`, `Omega2`, ...) should be written as `2`, not `sq`, `squared` or `pétit-deux` (*example:* `Chi2`, and **not** `Chisq`, `Eta2`, and **not** `Eta_squared`). This rule does **not** apply to function names.
50+
10) Converting between "easystats" style and "broom" style can be done with `insight::standardize_names()`.
51+
52+
## Documentation (roxygen2)
53+
54+
All exported functions must be documented using `roxygen2`-style comments (`#'`). The documentation should include:
55+
56+
* **Title:** A concise, one-line summary of what the function does.
57+
* **Description:** A more detailed paragraph explaining the function's purpose.
58+
* **`@param`:** A description for each function parameter.
59+
* **`@return`:** A description of the value the function returns.
60+
* **`@export`:** Tag to make the function available to users.
61+
* **`@examples` or `@examplesIf`:** Code demonstrating how to use the function.
62+
* **`@seealso`:** (Optional) Links to related functions.
63+
* **`@details`:** (Optional) Further details on the methodology or implementation.
64+
65+
## Dependencies
66+
67+
* Use base-R wherever possible (to reduce hard dependencies)
68+
* Make sure R-version requirements are not too strict
69+
* **Package Functions:** Always use the `::` operator to call functions from other packages (e.g., `stats::shapiro.test`, `insight::model_info`). Do not use `library()` or `require()` at the top of a file (no full import, only selective import of functions). However, in test files, package vignettes (.rmd), or in the package documentation, `::` is not required for core R packages like `stats` or `tools`.
70+
* **Conditional Checks:** Use `insight::check_if_installed("pkg_name")` to check if a package is available before using it, especially for optional ("Suggests") dependencies.
71+
* **Argument validation:** Use `insight::validate_argument()` instead of `match.arg()` to validate correct input of arguments, unless you need `several.ok`. In this case, rely on `match.arg()`.
72+
73+
## S3 Object System
74+
75+
* The projects make extensive use of the S3 object-oriented system.
76+
* **Generic Functions:** Define generic functions using `UseMethod("function_name")`.
77+
* **Methods:** Implement methods for specific object classes using the `function_name.class_name` naming convention (e.g., `check_normality.default`, `model_performance.lm`).
78+
79+
## Error Handling and Messaging
80+
81+
* Use `tryCatch` for operations that might fail. The internal `.safe()` helper is a good example.
82+
* Use the `insight` package's functions for user-facing messages:
83+
* For errors: `insight::format_error()`
84+
* For warnings: `insight::format_warning()`
85+
* For messages: `insight::format_alert()`
86+
* To highlight messages: `insight::print_color()`
87+
Note that character vectors are not pasted together, unlike in `message()`,
88+
thus you usually want to use something like `paste()` to concatenate the
89+
string. Character vectors will add a new paragraph for each string element,
90+
not paste them together.

NAMESPACE

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ S3method(as.data.frame,check_outliers)
1919
S3method(as.data.frame,icc)
2020
S3method(as.data.frame,looic)
2121
S3method(as.data.frame,performance_accuracy)
22-
S3method(as.data.frame,performance_cv)
2322
S3method(as.data.frame,performance_pcp)
2423
S3method(as.data.frame,performance_score)
2524
S3method(as.data.frame,r2_bayes)
@@ -129,6 +128,9 @@ S3method(check_predictions,brmsfit)
129128
S3method(check_predictions,default)
130129
S3method(check_predictions,lme)
131130
S3method(check_predictions,stanreg)
131+
S3method(check_priors,brmsfit)
132+
S3method(check_priors,default)
133+
S3method(check_priors,stanreg)
132134
S3method(check_residuals,DHARMa)
133135
S3method(check_residuals,default)
134136
S3method(check_residuals,fa)
@@ -319,6 +321,7 @@ S3method(plot,check_overdisp)
319321
S3method(plot,check_residuals)
320322
S3method(plot,check_sphericity)
321323
S3method(plot,compare_performance)
324+
S3method(plot,performance_check_priors)
322325
S3method(plot,performance_pp_check)
323326
S3method(plot,performance_roc)
324327
S3method(plot,performance_simres)
@@ -621,6 +624,7 @@ export(check_normality)
621624
export(check_outliers)
622625
export(check_overdispersion)
623626
export(check_predictions)
627+
export(check_priors)
624628
export(check_residuals)
625629
export(check_singularity)
626630
export(check_sphericity)

NEWS.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,86 @@
11
# performance (devel)
22

3+
## Changes
4+
5+
* `check_overdispersion()` gets a `residual_type` argument, to decide whether
6+
overdispersion tests are based on simulated or "standard" residuals.
7+
8+
* `check_model()` gains a `ppc_range` argument for posterior predictive checks
9+
plot. Use this to zoom in on a specific region of interest, especially if the
10+
response variable has a large range.
11+
12+
* `check_predictions()` gains a `x_limits` argument for plots. Use this to zoom
13+
in on a specific region of interest, especially if the response variable has
14+
a large range.
15+
16+
* New function `check_priors()` to conduct prior predictive checks for Bayesian
17+
models.
18+
19+
## Bug fixes
20+
21+
* The overdispersion plot in `check_model()` now uses simulated residuals (based
22+
on the *DHARMa* package) for `glmmTMB` models and mixed models. This fixes
23+
wonky-looking overdispersion plots for these model types (#654).
24+
25+
* Fixed the expected variance calculation in `.expected_variance()` so that
26+
`glmmTMB` `nbinom1` and `nbinom2` families use the correct formulas from the
27+
glmmTMB documentation: `nbinom1`: V = μ(1 + φ); `nbinom2`: V = μ(1 + μ/φ).
28+
Previously, glmmTMB `nbinom1` models incorrectly used the `nbinom2` formula
29+
because it matched a more general `is_negbin` branch first (#654).
30+
31+
# performance 0.17.0
32+
33+
## Changes
34+
35+
* `test_likelihoodratio()` now has a new 'Criterion' column containing the
36+
-2 * log-likelihood (-2LL) value for each model.
37+
38+
* Added more details to the troubleshooting section to the documentation of
39+
`check_model()`.
40+
41+
* `check_predictions()` for Bayesian models now uses
42+
`modelbased::estimate_prediction()` and returns posterior predictive data in
43+
the same format as for other supported models.
44+
45+
* Updated tests to work with the next release of the *DHARMa* package
46+
(version 0.5.0).
47+
348
## Bug fixes
449

50+
* Fixed issue in `check_collinearity()` for models from the *fixest* package.
51+
52+
* Fixed issue in `check_collinearity()` that was causing inflated VIF values
53+
when applied to clm and clmm models from the ordinal package.
54+
55+
* Fixed issue in `test_likelihoodratio.ListLavaan()` that was extracting the
56+
absolute model fit (Chisq) from the lavTestLRT output instead of the actual
57+
LRT test statistic (Chisq diff).
58+
59+
# performance 0.16.0
60+
61+
## Breaking Changes
62+
63+
* `model_performance()` for psych FA objects now correctly names the metric as
64+
`RMSR` (Root Mean Square Residual) instead of `RMSA`. The `RMSR_corrected`
65+
column (previously `RMSA_corrected`) is also renamed accordingly.
66+
67+
* The first argument in `check_model()`, `check_predictions()` and
68+
`check_convergence()` was renamed to `model`.
69+
70+
## Changes
71+
72+
* `check_model()` now limits the number of data points for models with many
73+
observations, to reduce the time for rendering the plot via the `maximum_dots`
74+
argument.
75+
76+
* `check_model()` can now show or hide confidence intervals using the `show_ci`
77+
argument. For models with only categorical predictors, confidence intervals
78+
are not shown by default.
79+
80+
## Bug fixes
81+
82+
* Fixed issue in `check_dag()` with multiple colliders.
83+
584
* Fixed CRAN check issues.
685

786
# performance 0.15.3

0 commit comments

Comments
 (0)