Skip to content

Commit a170cb0

Browse files
authored
Specify what environment f_env() returns (#1825)
Fixes #1789. This one doesn't feel like it needs a NEWS bullet.
1 parent e5fee11 commit a170cb0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

R/formula.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ is_bare_formula <- function(x, scoped = TRUE, lhs = NULL) {
101101
#' Get or set formula components
102102
#'
103103
#' `f_rhs` extracts the right-hand side, `f_lhs` extracts the left-hand
104-
#' side, and `f_env` extracts the environment. All functions throw an
105-
#' error if `f` is not a formula.
104+
#' side, and `f_env` extracts the environment in which the formula was defined.
105+
#' All functions throw an error if `f` is not a formula.
106106
#'
107107
#' @param f,x A formula
108108
#' @param value The value to replace with.
@@ -120,6 +120,8 @@ is_bare_formula <- function(x, scoped = TRUE, lhs = NULL) {
120120
#' f_lhs(x ~ y)
121121
#'
122122
#' f_env(~ x)
123+
#' f <- as.formula("y ~ x", env = new.env())
124+
#' f_env(f)
123125
f_rhs <- function(f) {
124126
if (is_quosure(f)) {
125127
signal_formula_access()

man/f_rhs.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)