Skip to content

Commit

Permalink
Remove vars() from exported functions
Browse files Browse the repository at this point in the history
Cause import warnings when both purrr and dplyr are imported.
Should eventually be reexported from rlang.

cc @ColinFay
  • Loading branch information
lionel- committed Jan 25, 2019
1 parent bd019c7 commit 5bef730
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 50 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export(splice)
export(tail_while)
export(transpose)
export(update_list)
export(vars)
export(vec_depth)
export(walk)
export(walk2)
Expand Down
10 changes: 7 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,14 @@ arguments.
manually with `!!!`. This change is for consistency with other
dots-collecting functions of the tidyverse.

* `map_at()`, `lmap_at()` and `modify_at()` now supports selection using `vars()`
and `tidyselect` (@ColinFay, #608)
* `map_at()`, `lmap_at()` and `modify_at()` now supports selection
using `vars()` and `tidyselect` (@ColinFay, #608).

* `detect()` now has a .default argument to specify the value returned when
Note that for now you need to import `vars()` from dplyr or call it
qualified like `dplyr::vars()`. It will be reexported from rlang in
a future release.

* `detect()` now has a .default argument to specify the value returned when
nothing is detected (#622, @ColinFay).


Expand Down
21 changes: 0 additions & 21 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,6 @@ check_tidyselect <- function(){
}
}

#' Select names
#'
#' This helper function is intended to provide a semantic equivalent to the one
#' from `dplyr::mutate_at()`. It can be used in the `*_at` functions of `purrr`
#' like `map_at()`. Note that the `tidyselect` package has to be installed.
#'
#' @param ... The variable to include in the selection. You can use bare name or
#' helpers from the `tidyselect` package.
#'
#' @export
#'
#' @examples
#' \dontrun{
#' library(tidyselect)
#' x <- list(a = "b", b = "c", aa = "bb")
#' map_at(x, vars(contains("a")), toupper)
#'}
vars <- function (...) {
quos(...)
}

at_selection <- function(nm, .at){
if (is_quosures(.at)){
check_tidyselect()
Expand Down
24 changes: 0 additions & 24 deletions man/vars.Rd

This file was deleted.

3 changes: 3 additions & 0 deletions tests/testthat/helper-map.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@

named <- function(x) set_names(x, chr())

# Until we can reexport from rlang
vars <- quos
1 change: 0 additions & 1 deletion tests/testthat/test-lmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test_that("lmap output is list if input is list", {
out
}
expect_is(lmap_at(x, vars(tidyselect::contains("a")), maybe_rep), "list")

})

test_that("lmap output is tibble if input is data frame", {
Expand Down

0 comments on commit 5bef730

Please sign in to comment.