Skip to content

Commit

Permalink
Prepare CRAN release (#977)
Browse files Browse the repository at this point in the history
* Prepare CRAN release

* fix, lintr

* Trigger CI

* Fix #978

* news

* typo, lintr

* lintr

* eval conditional on gt

* Update model_parameters_print.Rmd

* fix

* Update DESCRIPTION

* Update NEWS.md

* Update DESCRIPTION

* Update NEWS.md

* lintr

* lintr

* doc cleanup

* lintr

* update orcid

* newline

* update news

* docs

* typo

* support glmgee

* newline

* cran comm

* news

* wordlist

* submitted

* fix notes

* lintr

* re-submitted

---------

Co-authored-by: Indrajeet Patil <patilindrajeet.science@gmail.com>
  • Loading branch information
strengejacke and IndrajeetPatil committed Jun 20, 2024
1 parent 266c947 commit d4a3b3c
Show file tree
Hide file tree
Showing 38 changed files with 381 additions and 239 deletions.
3 changes: 2 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
linters: linters_with_defaults(
absolute_path_linter = NULL,
commented_code_linter = NULL,
cyclocomp_linter = cyclocomp_linter(25),
cyclocomp_linter = cyclocomp_linter(125),
extraction_operator_linter = NULL,
implicit_integer_linter = NULL,
line_length_linter(120),
namespace_linter = NULL,
nonportable_path_linter = NULL,
object_name_linter = NULL,
object_length_linter(50),
library_call_linter = NULL,
object_usage_linter = NULL,
todo_comment_linter = NULL,
undesirable_function_linter(c("mapply" = NA, "sapply" = NA, "setwd" = NA)),
Expand Down
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.21.7
Date: 2024-05-13 17:50:43 UTC
SHA: 5c707ee00026cae0f4439eb8514e2537275344cc
Version: 0.22.0
Date: 2024-06-19 20:40:00 UTC
SHA: 3861512ee3c11ecca44c2edd412c2a5cb65e1f59
11 changes: 4 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: parameters
Title: Processing of Model Parameters
Version: 0.21.7.4
Version: 0.22.0
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -40,7 +40,7 @@ Authors@R:
family = "Arel-Bundock",
role = "ctb",
email = "vincent.arel-bundock@umontreal.ca",
comment = c(ORCID = "0000-0003-1995-6531", Twitter = "@vincentab")),
comment = c(ORCID = "0000-0003-2042-7063", Twitter = "@vincentab")),
person(given = "Jeffrey",
family = "Girard",
role = "ctb",
Expand Down Expand Up @@ -177,7 +177,7 @@ Suggests:
panelr,
pbkrtest,
PCDimension,
performance (>= 0.10.8),
performance (>= 0.12.0),
plm,
PMCMRplus,
poorman,
Expand Down Expand Up @@ -213,8 +213,5 @@ RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/testthat/parallel: true
Config/Needs/website:
rstudio/bslib,
r-lib/pkgdown,
easystats/easystatstemplate
Config/Needs/website: easystats/easystatstemplate
Config/rcmdcheck/ignore-inconsequential-notes: true
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ S3method(ci,gamm4)
S3method(ci,geeglm)
S3method(ci,glht)
S3method(ci,glm)
S3method(ci,glmgee)
S3method(ci,glmm)
S3method(ci,glmmTMB)
S3method(ci,hglm)
Expand Down Expand Up @@ -462,6 +463,7 @@ S3method(p_value,gee)
S3method(p_value,geeglm)
S3method(p_value,glht)
S3method(p_value,glimML)
S3method(p_value,glmgee)
S3method(p_value,glmm)
S3method(p_value,glmx)
S3method(p_value,gls)
Expand Down Expand Up @@ -792,6 +794,7 @@ S3method(standard_error,gee)
S3method(standard_error,geeglm)
S3method(standard_error,glht)
S3method(standard_error,glimML)
S3method(standard_error,glmgee)
S3method(standard_error,glmm)
S3method(standard_error,glmmTMB)
S3method(standard_error,glmx)
Expand Down
15 changes: 11 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# parameters 0.21.8
# parameters 0.22.0

## Breaking changes

* Deprecated arguments in `model_parameters()` for `htest`, `aov` and
`BFBayesFactor` objects were removed.

* Argument `effectsize_type` is deprecated. Please use `es_type` now. This change
was necessary to avoid conflicts with partial matching of argument names (here:
`effects`).

## New supported models

* Support for objects from `stats::Box.test()`.

## Bug fixes
* Support for `glmgee` models from package *glmtoolbox*.

## Bug fix

* Fixed edge case in `predict()` for `factor_analysis()`.

* Fixed issues with partial matching of argument `effects` and `effectsize_type`
in `model_parameters()` for objects of class `htest`.
* Fixed wrong ORCID in `DESCRIPTION`.

# parameters 0.21.7

Expand Down
2 changes: 1 addition & 1 deletion R/1_model_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#' include interactions or transformations (e.g., polynomial or spline terms).
#' The `robust` (default to `FALSE`) argument enables a robust standardization
#' of data, i.e., based on the `median` and `MAD` instead of the `mean` and
#' `SD`. **See [standardize()] for more details.**
#' `SD`. **See [`datawizard::standardize()`] for more details.**
#' **Note** that `standardize_parameters(method = "refit")` may not return
#' the same results as fitting a model on data that has been standardized with
#' `standardize()`; `standardize_parameters()` used the data used by the model
Expand Down
6 changes: 2 additions & 4 deletions R/bootstrap_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ bootstrap_model.merMod <- function(model,
} else {
params <- stats::setNames(params$Estimate, params$Parameter) # Transform to named vector
}
return(params)
params
}

if (verbose) {
Expand Down Expand Up @@ -244,9 +244,7 @@ bootstrap_model.nestedLogit <- function(model,
}

params <- insight::get_parameters(fit, verbose = FALSE)
params <- stats::setNames(params$Estimate, params$Parameter) # Transform to named vector

return(params)
stats::setNames(params$Estimate, params$Parameter) # Transform to named vector
}

results <- boot::boot(
Expand Down
8 changes: 5 additions & 3 deletions R/extract_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
verbose = TRUE) {
# check pattern
if (!is.null(keep) && length(keep) > 1) {
keep <- paste0("(", paste0(keep, collapse = "|"), ")")
keep <- paste0("(", paste(keep, collapse = "|"), ")")
if (verbose) {
insight::format_alert(
sprintf("The `keep` argument has more than 1 element. Merging into following regular expression: `%s`.", keep)
Expand All @@ -365,7 +365,7 @@

# check pattern
if (!is.null(drop) && length(drop) > 1) {
drop <- paste0("(", paste0(drop, collapse = "|"), ")")
drop <- paste0("(", paste(drop, collapse = "|"), ")")
if (verbose) {
insight::format_alert(
sprintf("The `drop` argument has more than 1 element. Merging into following regular expression: `%s`.", drop)
Expand Down Expand Up @@ -486,7 +486,9 @@
} else {
ci_df <- ci(model, ci = ci, method = ci_method, effects = "fixed")
}
if (length(ci) > 1) ci_df <- datawizard::reshape_ci(ci_df)
if (length(ci) > 1) {
ci_df <- datawizard::reshape_ci(ci_df)
}
ci_cols <- names(ci_df)[!names(ci_df) %in% c("CI", "Parameter")]
parameters <- merge(parameters, ci_df, by = "Parameter", sort = FALSE)
}
Expand Down
23 changes: 15 additions & 8 deletions R/methods_BayesFactor.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#' # Bayesian t-test
#' model <- BayesFactor::ttestBF(x = rnorm(100, 1, 1))
#' model_parameters(model)
#' model_parameters(model, effectsize_type = "cohens_d", ci = 0.9)
#' model_parameters(model, es_type = "cohens_d", ci = 0.9)
#'
#' # Bayesian contingency table analysis
#' data(raceDolls)
Expand All @@ -46,7 +46,7 @@
#' centrality = "mean",
#' dispersion = TRUE,
#' verbose = FALSE,
#' effectsize_type = "cramers_v"
#' es_type = "cramers_v"
#' )
#' }
#' @return A data frame of indices related to the model's parameters.
Expand All @@ -60,9 +60,10 @@ model_parameters.BFBayesFactor <- function(model,
rope_range = "default",
rope_ci = 0.95,
priors = TRUE,
effectsize_type = NULL,
es_type = NULL,
include_proportions = FALSE,
verbose = TRUE,
effectsize_type = NULL,
...) {
insight::check_if_installed("BayesFactor")

Expand All @@ -83,6 +84,12 @@ model_parameters.BFBayesFactor <- function(model,
return(NULL)
}

## TODO: remove deprecation warning later
if (!is.null(effectsize_type)) {
insight::format_warning("Argument `effectsize_type` is deprecated. Use `es_type` instead.")
es_type <- effectsize_type
}

out <- bayestestR::describe_posterior(
model,
centrality = centrality,
Expand Down Expand Up @@ -115,10 +122,10 @@ model_parameters.BFBayesFactor <- function(model,
tryCatch(
{
bfm <- as.data.frame(bayestestR::bayesfactor_models(model)[-1, ])
if (!is.null(bfm$log_BF)) {
out$BF <- exp(bfm$log_BF)
} else {
if (is.null(bfm$log_BF)) {
out$BF <- bfm$BF
} else {
out$BF <- exp(bfm$log_BF)
}
},
error = function(e) {
Expand All @@ -132,7 +139,7 @@ model_parameters.BFBayesFactor <- function(model,
}

# Effect size?
if (!is.null(effectsize_type)) {
if (!is.null(es_type)) {
# needs {effectsize} to be installed
insight::check_if_installed("effectsize")

Expand All @@ -144,7 +151,7 @@ model_parameters.BFBayesFactor <- function(model,
dispersion = dispersion,
ci_method = ci_method,
rope_ci = rope_ci,
type = effectsize_type,
type = es_type,
...
)

Expand Down
Loading

0 comments on commit d4a3b3c

Please sign in to comment.