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

remove Suggests for lsmeans and emmeans #1194

Merged
merged 1 commit into from
Mar 20, 2024
Merged
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: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ Suggests:
covr,
drc,
e1071,
emmeans,
epiR,
ergm (>= 3.10.4),
fixest (>= 0.9.0),
Expand All @@ -596,7 +595,6 @@ Suggests:
lme4,
lmodel2,
lmtest (>= 0.9.38),
lsmeans,
maps,
margins,
MASS,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# broom (development version)

* Removed lsmeans and emmeans as Suggested packages as the packages have a dependency requiring R 4.3.0 or higher. To maintain compatibility with at least 4 previous minor versions of R, broom won't test support for these packages until the release of R 4.7.x (or until lsmeans and emmeans are compatible with the R version 4 minor releases previous, #1193).

* Moved forward with deprecation of tidiers for objects from the sp package. See resources linked in [tidymodels/broom#1142](https://github.com/tidymodels/broom/issues/1142) for more information on migration from retiring spatial packages.

* Corrected confidence interval values for precision components in `tidy.betareg()` output (#1169).
Expand Down
119 changes: 60 additions & 59 deletions R/emmeans-tidiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#'
#' @param x An `lsmobj` object.
#' @template param_confint
#' @param ... Additional arguments passed to [emmeans::summary.emmGrid()] or
#' [lsmeans::summary.ref.grid()]. **Cautionary note**: misspecified arguments
#' @param ... Additional arguments passed to `emmeans::summary.emmGrid()` or
#' `lsmeans::summary.ref.grid()`. **Cautionary note**: misspecified arguments
#' may be silently ignored!
#'
#' @evalRd return_tidy(
Expand All @@ -24,61 +24,62 @@
#' contrast, each row will contain one estimated contrast.
#'
#' There are a large number of arguments that can be
#' passed on to [emmeans::summary.emmGrid()] or [lsmeans::summary.ref.grid()].
#'
#' @examplesIf rlang::is_installed(c("emmeans", "ggplot2"))
#'
#' # load libraries for models and data
#' library(emmeans)
#'
#' # linear model for sales of oranges per day
#' oranges_lm1 <- lm(sales1 ~ price1 + price2 + day + store, data = oranges)
#'
#' # reference grid; see vignette("basics", package = "emmeans")
#' oranges_rg1 <- ref_grid(oranges_lm1)
#' td <- tidy(oranges_rg1)
#' td
#'
#' # marginal averages
#' marginal <- emmeans(oranges_rg1, "day")
#' tidy(marginal)
#'
#' # contrasts
#' tidy(contrast(marginal))
#' tidy(contrast(marginal, method = "pairwise"))
#'
#' # plot confidence intervals
#' library(ggplot2)
#'
#' ggplot(tidy(marginal, conf.int = TRUE), aes(day, estimate)) +
#' geom_point() +
#' geom_errorbar(aes(ymin = conf.low, ymax = conf.high))
#'
#' # by multiple prices
#' by_price <- emmeans(oranges_lm1, "day",
#' by = "price2",
#' at = list(
#' price1 = 50, price2 = c(40, 60, 80),
#' day = c("2", "3", "4")
#' )
#' )
#'
#' by_price
#'
#' tidy(by_price)
#'
#' ggplot(tidy(by_price, conf.int = TRUE), aes(price2, estimate, color = day)) +
#' geom_line() +
#' geom_errorbar(aes(ymin = conf.low, ymax = conf.high))
#'
#' # joint_tests
#' tidy(joint_tests(oranges_lm1))
#' passed on to `emmeans::summary.emmGrid()` or `lsmeans::summary.ref.grid()`.
#'
# examples no longer supplied, see #1193
# @examplesIf rlang::is_installed(c("emmeans", "ggplot2"))
#
# # load libraries for models and data
# library(emmeans)
#
# # linear model for sales of oranges per day
# oranges_lm1 <- lm(sales1 ~ price1 + price2 + day + store, data = oranges)
#
# # reference grid; see vignette("basics", package = "emmeans")
# oranges_rg1 <- ref_grid(oranges_lm1)
# td <- tidy(oranges_rg1)
# td
#
# # marginal averages
# marginal <- emmeans(oranges_rg1, "day")
# tidy(marginal)
#
# # contrasts
# tidy(contrast(marginal))
# tidy(contrast(marginal, method = "pairwise"))
#
# # plot confidence intervals
# library(ggplot2)
#
# ggplot(tidy(marginal, conf.int = TRUE), aes(day, estimate)) +
# geom_point() +
# geom_errorbar(aes(ymin = conf.low, ymax = conf.high))
#
# # by multiple prices
# by_price <- emmeans(oranges_lm1, "day",
# by = "price2",
# at = list(
# price1 = 50, price2 = c(40, 60, 80),
# day = c("2", "3", "4")
# )
# )
#
# by_price
#
# tidy(by_price)
#
# ggplot(tidy(by_price, conf.int = TRUE), aes(price2, estimate, color = day)) +
# geom_line() +
# geom_errorbar(aes(ymin = conf.low, ymax = conf.high))
#
# # joint_tests
# tidy(joint_tests(oranges_lm1))
#
#' @aliases emmeans_tidiers
#' @export
#' @family emmeans tidiers
#' @seealso [tidy()], [emmeans::ref_grid()], [emmeans::emmeans()],
#' [emmeans::contrast()]
#' @seealso [tidy()], `emmeans::ref_grid()`, `emmeans::emmeans()`,
#' `emmeans::contrast()`
tidy.lsmobj <- function(x, conf.int = FALSE, conf.level = .95, ...) {
check_ellipses("exponentiate", "tidy", "lsmobj", ...)

Expand All @@ -103,8 +104,8 @@ tidy.lsmobj <- function(x, conf.int = FALSE, conf.level = .95, ...) {
#'
#' @export
#' @family emmeans tidiers
#' @seealso [tidy()], [emmeans::ref_grid()], [emmeans::emmeans()],
#' [emmeans::contrast()]
#' @seealso [tidy()], `emmeans::ref_grid()`, `emmeans::emmeans()`,
#' `emmeans::contrast()`
tidy.ref.grid <- function(x, conf.int = FALSE, conf.level = .95, ...) {
check_ellipses("exponentiate", "tidy", "ref.grid", ...)

Expand All @@ -129,8 +130,8 @@ tidy.ref.grid <- function(x, conf.int = FALSE, conf.level = .95, ...) {
#'
#' @export
#' @family emmeans tidiers
#' @seealso [tidy()], [emmeans::ref_grid()], [emmeans::emmeans()],
#' [emmeans::contrast()]
#' @seealso [tidy()], `emmeans::ref_grid()`, `emmeans::emmeans()`,
#' `emmeans::contrast()`
tidy.emmGrid <- function(x, conf.int = FALSE, conf.level = .95, ...) {
check_ellipses("exponentiate", "tidy", "emmGrid", ...)

Expand Down Expand Up @@ -163,8 +164,8 @@ tidy.emmGrid <- function(x, conf.int = FALSE, conf.level = .95, ...) {
#'
#' @export
#' @family emmeans tidiers
#' @seealso [tidy()], [emmeans::ref_grid()], [emmeans::emmeans()],
#' [emmeans::contrast()]
#' @seealso [tidy()], `emmeans::ref_grid()`, `emmeans::emmeans()`,
#' `emmeans::contrast()`

tidy.summary_emm <- function(x, null.value = NULL, ...) {
check_ellipses("exponentiate", "tidy", "summary_emm", ...)
Expand Down
60 changes: 5 additions & 55 deletions man/tidy.emmGrid.Rd

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

60 changes: 5 additions & 55 deletions man/tidy.lsmobj.Rd

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

Loading
Loading