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

marginaleffects::marginal_means deprecation #246

Closed
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.2.3.9000
RoxygenNote: 7.3.0
Config/testthat/edition: 3
Config/testthat/parallel: true
Roxygen: list(markdown = TRUE)
Expand Down
12 changes: 3 additions & 9 deletions R/estimate_means.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#'
#' @inheritParams get_emmeans
#' @inheritParams parameters::model_parameters.default
#' @param backend Whether to use 'emmeans' or 'marginaleffects' as a backend.
#' The latter is experimental and some features might not work.
#' @inherit estimate_slopes details
#'
#' @examplesIf require("emmeans", quietly = TRUE)
Expand Down Expand Up @@ -51,10 +49,10 @@
fixed = NULL,
transform = "response",
ci = 0.95,
backend = "emmeans",
# backend = "emmeans",

Check warning on line 52 in R/estimate_means.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/estimate_means.R,line=52,col=30,[commented_code_linter] Remove commented code.

Check warning on line 52 in R/estimate_means.R

View workflow job for this annotation

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

file=R/estimate_means.R,line=52,col=30,[commented_code_linter] Remove commented code.
...) {
# Compute means
if (backend == "emmeans") {
# if (backend == "emmeans") {
estimated <- get_emmeans(model, at, fixed, transform = transform, ...)

# Summarize and clean
Expand All @@ -62,7 +60,7 @@
means <- parameters::parameters(estimated, ci = ci, ...)
means <- .clean_names_bayesian(means, model, transform, type = "mean")
means <- cbind(estimated@grid, means)
means$`.wgt.` <- NULL # Drop the weight column

Check warning on line 63 in R/estimate_means.R

View workflow job for this annotation

GitHub Actions / lint / lint

file=R/estimate_means.R,line=63,col=13,[keyword_quote_linter] Only quote targets of extraction with $ if necessary, i.e., if the name is not a valid R symbol (see ?make.names). Use backticks to create non-syntactic names, or use [[ to extract by string.

Check warning on line 63 in R/estimate_means.R

View workflow job for this annotation

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

file=R/estimate_means.R,line=63,col=13,[keyword_quote_linter] Only quote targets of extraction with $ if necessary, i.e., if the name is not a valid R symbol (see ?make.names). Use backticks to create non-syntactic names, or use [[ to extract by string.
} else {
means <- as.data.frame(stats::confint(estimated, level = ci))
means$df <- NULL
Expand All @@ -72,11 +70,7 @@
means <- means[names(means) != "1"]

info <- attributes(estimated)
} else {
means <- .get_marginalmeans(model, at, fixed, transform = transform, ...)

info <- attributes(means)
}
# }

# Restore factor levels
means <- datawizard::data_restoretype(means, insight::get_data(model))
Expand Down
65 changes: 0 additions & 65 deletions R/get_marginalcontrasts.R

This file was deleted.

42 changes: 0 additions & 42 deletions R/get_marginalmeans.R

This file was deleted.

4 changes: 0 additions & 4 deletions man/estimate_means.Rd

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

1 change: 0 additions & 1 deletion man/modelbased-package.Rd

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

12 changes: 0 additions & 12 deletions tests/testthat/test-get_marginalmeans.R

This file was deleted.

Loading