Skip to content

Commit

Permalink
add NEWS bullet
Browse files Browse the repository at this point in the history
  • Loading branch information
eutwt committed Dec 6, 2021
1 parent 654fa5c commit 2b949e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
@@ -1,5 +1,8 @@
# dtplyr (development version)

* When called within a function, `across()` can access variables in that
function's execution environment.

# dtplyr 1.2.0

## New authors
Expand Down
2 changes: 2 additions & 0 deletions R/tidyeval-across.R
Expand Up @@ -8,6 +8,8 @@ dt_squash_across <- function(call, env, data, j = j) {

tbl <- simulate_vars(data, drop_groups = TRUE)
.cols <- call$.cols %||% expr(everything())
print(.cols)
str(.cols)
locs <- tidyselect::eval_select(.cols, tbl, env = env)
cols <- syms(names(tbl))[locs]

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tidyeval-across.R
Expand Up @@ -160,7 +160,7 @@ test_that("across() can handle empty selection", {
)
})

test_that("across() can access function environment", {
test_that("across() can access execution environment of parent function", {
dt <- lazy_dt(data.frame(y = 1))
fun <- function(x) capture_across(dt, across(all_of(x)))
expect_equal(
Expand Down

0 comments on commit 2b949e6

Please sign in to comment.