Skip to content

Commit

Permalink
prepare CRAN hotfix (#876)
Browse files Browse the repository at this point in the history
* prepare CRAN hotfix

* requires insight dev

* check on insight dev

* update NAMESPACE

* update wordlist

* remove remotes

* cran comments, release version

* submitted

* Revert "Remove re-exports (#873)"

This reverts commit 9a654da.

* news

* cran comments

* submitted
  • Loading branch information
strengejacke committed Apr 19, 2023
1 parent a5fe6bf commit e90b9d0
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 68 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.20.3
Date: 2023-04-05 06:07:12 UTC
SHA: ac64894ca63668acf04804f79a9f02490ade31ca
Version: 0.21.0
Date: 2023-04-19 11:52:51 UTC
SHA: ad9c5390202be4b3132e30dd122cad323f0cbec7
3 changes: 1 addition & 2 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.20.3.1
Version: 0.21.0
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down Expand Up @@ -140,7 +140,6 @@ Suggests:
ivreg,
knitr,
lavaan,
lavaSearch2,
lfe,
lm.beta,
lme4,
Expand Down
17 changes: 14 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ S3method(display,parameters_pca)
S3method(display,parameters_pca_summary)
S3method(display,parameters_sem)
S3method(display,parameters_simulate)
S3method(dof_satterthwaite,lme)
S3method(dof_satterthwaite,lmerMod)
S3method(equivalence_test,MixMod)
S3method(equivalence_test,feis)
Expand Down Expand Up @@ -624,8 +623,6 @@ S3method(reduce_parameters,merMod)
S3method(reshape_loadings,data.frame)
S3method(reshape_loadings,parameters_efa)
S3method(se_satterthwaite,default)
S3method(se_satterthwaite,gls)
S3method(se_satterthwaite,lme)
S3method(select_parameters,lm)
S3method(select_parameters,merMod)
S3method(simulate_model,LORgee)
Expand Down Expand Up @@ -914,6 +911,8 @@ export(confidence_curve)
export(consonance_function)
export(convert_efa_to_cfa)
export(degrees_of_freedom)
export(demean)
export(describe_distribution)
export(display)
export(dof)
export(dof_betwithin)
Expand All @@ -929,6 +928,7 @@ export(format_order)
export(format_p_adjust)
export(format_parameters)
export(get_scores)
export(kurtosis)
export(model_parameters)
export(n_clusters)
export(n_clusters_dbscan)
Expand All @@ -955,27 +955,38 @@ export(print_md)
export(random_parameters)
export(reduce_data)
export(reduce_parameters)
export(rescale_weights)
export(reshape_loadings)
export(rotated_data)
export(se_kenward)
export(se_satterthwaite)
export(select_parameters)
export(simulate_model)
export(simulate_parameters)
export(skewness)
export(sort_parameters)
export(standard_error)
export(standardise_info)
export(standardise_parameters)
export(standardise_posteriors)
export(standardize_info)
export(standardize_names)
export(standardize_parameters)
export(standardize_posteriors)
export(supported_models)
export(visualisation_recipe)
importFrom(bayestestR,ci)
importFrom(bayestestR,equivalence_test)
importFrom(datawizard,demean)
importFrom(datawizard,describe_distribution)
importFrom(datawizard,kurtosis)
importFrom(datawizard,rescale_weights)
importFrom(datawizard,skewness)
importFrom(datawizard,visualisation_recipe)
importFrom(graphics,plot)
importFrom(insight,display)
importFrom(insight,n_parameters)
importFrom(insight,print_html)
importFrom(insight,print_md)
importFrom(insight,standardize_names)
importFrom(insight,supported_models)
8 changes: 3 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

## Breaking Changes

* As noted in release notes for 0.15.0 version, all re-exported functions from
*datawizard* package have now been removed.

* Following re-exported functions from *insight* have been removed:
`standardize_names()`, `supported_models()`
* It is no longer possible to calculate Satterthwaite-approximated degrees of
freedom for mixed models from package *nlme*. This was based on the
*lavaSearch2* package, which no longer seems to support models of class `lme`.

## Changes to functions

Expand Down
11 changes: 0 additions & 11 deletions R/dof_satterthwaite.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,3 @@ dof_satterthwaite.lmerMod <- function(model) {

stats::setNames(as.vector(s$coefficients[, 3]), parameters)
}


#' @export
dof_satterthwaite.lme <- function(model) {
insight::check_if_installed("lavaSearch2")

parameters <- insight::find_parameters(model, effects = "fixed", flatten = TRUE)
lavaSearch2::sCorrect(model) <- TRUE
s <- lavaSearch2::summary2(model)
stats::setNames(as.vector(s$tTable[, "df"]), parameters)
}
6 changes: 1 addition & 5 deletions R/methods_nlme.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ci.lme <- function(x,
method = "wald",
...) {
method <- tolower(method)
method <- match.arg(method, choices = c("wald", "normal", "residual", "betwithin", "ml1", "satterthwaite"))
method <- match.arg(method, choices = c("wald", "normal", "residual", "betwithin", "ml1"))

if (method %in% c("wald", "residual", "normal")) {
# `vcov` argument must be computed using the `.ci_generic` function.
Expand Down Expand Up @@ -49,10 +49,6 @@ ci.lme <- function(x,
# betwithin approx
} else if (method == "betwithin") {
ci_betwithin(x, ci)

# Satterthwaite
} else if (method == "satterthwaite") {
ci_satterthwaite(x, ci)
}
}

Expand Down
32 changes: 32 additions & 0 deletions R/reexports.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
# ----------------------- insight -------------------------------------

#' @importFrom insight standardize_names
#' @export
insight::standardize_names

#' @importFrom insight supported_models
#' @export
insight::supported_models

#' @importFrom insight print_html
#' @export
insight::print_html

# ----------------------- datawizard -------------------------------------

#' @importFrom datawizard describe_distribution
#' @export
datawizard::describe_distribution

#' @importFrom datawizard demean
#' @export
datawizard::demean

#' @importFrom datawizard rescale_weights
#' @export
datawizard::rescale_weights

#' @importFrom datawizard visualisation_recipe
#' @export
datawizard::visualisation_recipe

#' @importFrom datawizard kurtosis
#' @export
datawizard::kurtosis

#' @importFrom datawizard skewness
#' @export
datawizard::skewness
16 changes: 0 additions & 16 deletions R/standard_error_satterthwaite.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,3 @@ se_satterthwaite.default <- function(model) {
.is_model_valid(model)
standard_error(model)
}

#' @export
se_satterthwaite.lme <- function(model) {
insight::check_if_installed("lavaSearch2")
params <- insight::get_parameters(model, effects = "fixed")
lavaSearch2::sCorrect(model) <- TRUE
s <- lavaSearch2::summary2(model)

.data_frame(
Parameter = params$Parameter,
SE = as.vector(s$tTable[, "Std.Error"])
)
}

#' @export
se_satterthwaite.gls <- se_satterthwaite.lme
8 changes: 5 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
This update fixes CRAN check issues due to breaking changes in the *lavaSearch2* package, as requested by the CRAN team.

## revdepcheck results

We checked 33 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 1 new problems
* We saw 0 new problems
* We failed to check 0 packages

This update breaks the *performance* package. Test failures are expected, because a bug fix in *parameters* affects test results of the *performance* package. Tests have been corrected and an update of *performance* is ready to be submitted once the *parameters* package is accepted on CRAN.
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ jstatsoft
kmeans
labelled
lavaan
lavaSearch
lesslikely
lm
lme
Expand Down
11 changes: 9 additions & 2 deletions man/reexports.Rd

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

17 changes: 0 additions & 17 deletions tests/testthat/test-lme.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
skip_if_not_installed("nlme")
skip_if_not_installed("lme4")
skip_if_not_installed("lavaSearch2")

data("sleepstudy", package = "lme4")
m1_lme <- nlme::lme(Reaction ~ Days, random = ~ 1 + Days | Subject, data = sleepstudy)
Expand Down Expand Up @@ -96,19 +95,3 @@ test_that("model_parameters", {
# expect_equal(params$df, c(80, 80, 25), tolerance = 1e-4)
expect_equal(params$CI_low, c(16.07503, 0.53834, -3.82999), tolerance = 1e-4)
})

test_that("model_parameters, satterthwaite", {
params <- model_parameters(m2_lme, ci_method = "satterthwaite", effects = "fixed")
expect_equal(params$Coefficient, c(17.70671, 0.66019, -2.32102), tolerance = 1e-4)
expect_equal(params$SE, c(0.83155, 0.06209, 0.74307), tolerance = 1e-4)
# expect_equal(params$df, c(104.1503, 82.87867, 26.25), tolerance = 1e-4)
expect_equal(params$CI_low, c(16.0391, 0.53609, -3.88541), tolerance = 1e-3)
})

test_that("model_parameters, satterthwaite", {
params <- model_parameters(m2_lme, ci_method = "satterthwaite", effects = "all")
expect_equal(params$Coefficient, c(17.70671, 0.66019, -2.32102, 1.73008, 1.42273), tolerance = 1e-4)
expect_equal(params$SE, c(0.83155, 0.06209, 0.74307, NA, NA), tolerance = 1e-4)
# expect_equal(params$df, c(104.1503, 82.87867, 26.25), tolerance = 1e-4)
expect_equal(params$CI_low, c(16.0391, 0.53609, -3.88541, NA, NA), tolerance = 1e-3)
})
1 change: 1 addition & 0 deletions tests/testthat/test-mipo.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
skip_if_not_installed("mice")
skip_if_not_installed("nnet")
skip_if_not(packageVersion("insight") > "0.19.1")

test_that("param ordinal", {
set.seed(1234)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-model_parameters.mixed.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ test_that("model_parameters.mixed-all_pars", {
data("qol_cancer")
qol_cancer <- cbind(
qol_cancer,
datawizard::demean(qol_cancer, select = c("phq4", "QoL"), group = "ID")
demean(qol_cancer, select = c("phq4", "QoL"), group = "ID")
)
model <- lme4::lmer(
QoL ~ time + phq4_within + phq4_between + (1 | ID),
Expand Down

0 comments on commit e90b9d0

Please sign in to comment.