Skip to content

Commit

Permalink
Scoping fix to subset.emmGrid (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvlenth committed Jan 16, 2025
1 parent 8678372 commit 908d177
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: emmeans
Type: Package
Title: Estimated Marginal Means, aka Least-Squares Means
Version: 1.10.6-090003
Date: 2025-01-08
Date: 2025-01-16
Authors@R: c(person("Russell V.", "Lenth", role = c("aut", "cre", "cph"),
email = "russell-lenth@uiowa.edu"),
person("Balazs", "Banfai", role = "ctb"),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ title: "NEWS for the emmeans package"
would be obtained when `B` is not regarded as a counterfactual.
* Tweaks to `regrid()` to create `@post.beta` slot correctly when there are
non-estimable cases.
* Bug fix for scoping in `subset.emmGrid()` (#518)


## emmeans 1.10.6
Expand Down
4 changes: 2 additions & 2 deletions R/rbind.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# Copyright (c) 2012-2024 Russell V. Lenth #
# Copyright (c) 2012-2025 Russell V. Lenth #
# #
# This file is part of the emmeans package for R (*emmeans*) #
# #
Expand Down Expand Up @@ -163,7 +163,7 @@ rbind.emmGrid = function(..., deparse.level = 1, adjust = "bonferroni") {
#' subset(warp.rg, wool == "A") ## or warp.rg |> subset(wool == "A")
#'
subset.emmGrid = function(x, subset, ...) {
sel = eval(substitute(subset), envir = x@grid)
sel = eval(substitute(subset), envir = x@grid, enclos = parent.frame())
x[sel, ...]
}

Expand Down

0 comments on commit 908d177

Please sign in to comment.