Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke authored Feb 7, 2024
2 parents e67fbd5 + e2a7d5f commit 245a238
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 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.21.4
Date: 2024-02-03 21:38:27 UTC
SHA: 48a16ce752065c5b09eff5cbb5ecd3c22c2bc32d
Version: 0.21.5
Date: 2024-02-05 20:27:13 UTC
SHA: 00b4bebae447c23d7e1663ceac675a9d4329aa24
2 changes: 1 addition & 1 deletion 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.4
Version: 0.21.5
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# parameters 0.21.5

## Bug fixes

* Fixes CRAN check errors related to the changes in the latest update of
*marginaleffects*.

# parameters 0.21.4

## Breaking changes
Expand Down
11 changes: 2 additions & 9 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
Maintainance release.
Hotfix to address errors in CRAN checks related to the last *marginaleffects* update.

## revdepcheck results

We checked 33 reverse dependencies (27 from CRAN + 6 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.

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

This update breaks the *see* package. The maintainer is informed and prepared a fix, which is ready to be submitted once this submission is accepted on CRAN.
Not that this update still breaks the *see* package, since the previous submission of *parameters* was just yesterday - sorry for the bad timing! An update of the *see* package will submitted once this submission is accepted on CRAN.
24 changes: 7 additions & 17 deletions tests/testthat/test-marginaleffects.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
skip_if_not_installed("marginaleffects", minimum_version = "0.15.0")
skip_if_not_installed("marginaleffects", minimum_version = "0.18.0")
skip_if_not_installed("rstanarm")

test_that("marginaleffects()", {
# Frequentist
x <- lm(Sepal.Width ~ Species * Petal.Length, data = iris)
model <- marginaleffects::slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
out <- parameters(model)
expect_identical(nrow(out), 1L)
expect_named(out, c(
"Parameter", "Comparison", "Coefficient", "SE", "Statistic",
"p", "CI", "CI_low", "CI_high"
"Parameter", "Coefficient", "SE", "Statistic",
"p", "s.value", "CI", "CI_low", "CI_high"
))
out <- model_parameters(model, exponentiate = TRUE)
expect_equal(out$Coefficient, 1.394, tolerance = 1e-3)
Expand All @@ -24,7 +24,7 @@ test_that("marginaleffects()", {
chains = 1
)
)
model <- marginaleffects::slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
model <- marginaleffects::avg_slopes(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
expect_identical(nrow(parameters(model)), 1L)
})

Expand All @@ -47,7 +47,7 @@ test_that("comparisons()", {
data(iris)
# Frequentist
x <- lm(Sepal.Width ~ Species * Petal.Length, data = iris)
m <- marginaleffects::comparisons(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
m <- marginaleffects::avg_comparisons(x, newdata = insight::get_datagrid(x, at = "Species"), variables = "Petal.Length")
expect_identical(nrow(parameters(m)), 1L)
out <- parameters(m, exponentiate = TRUE)
expect_equal(out$Coefficient, 1.393999, tolerance = 1e-4)
Expand All @@ -62,7 +62,7 @@ test_that("comparisons()", {
chains = 1
)
)
m <- marginaleffects::slopes(
m <- marginaleffects::avg_slopes(
x,
newdata = insight::get_datagrid(x, at = "Species"),
variables = "Petal.Length"
Expand All @@ -71,16 +71,6 @@ test_that("comparisons()", {
})


test_that("marginalmeans()", {
data(mtcars)
dat <- mtcars
dat$cyl <- factor(dat$cyl)
dat$gear <- factor(dat$gear)
x <- lm(mpg ~ cyl + gear, data = dat)
m <- marginaleffects::marginalmeans(x)
expect_identical(nrow(parameters(m)), 6L)
})


test_that("hypotheses()", {
data(mtcars)
Expand Down

0 comments on commit 245a238

Please sign in to comment.