Skip to content

Commit 8602abd

Browse files
committed
Implement recode_values() and replace_values()
1 parent feaca13 commit 8602abd

File tree

9 files changed

+1443
-1
lines changed

9 files changed

+1443
-1
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ export(quo_name)
374374
export(quos)
375375
export(recode)
376376
export(recode_factor)
377+
export(recode_values)
377378
export(reframe)
378379
export(relocate)
379380
export(rename)
@@ -384,6 +385,7 @@ export(rename_if)
384385
export(rename_vars)
385386
export(rename_vars_)
386387
export(rename_with)
388+
export(replace_values)
387389
export(replace_when)
388390
export(right_join)
389391
export(row_number)

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
`recode_values()` and `replace_values()` have the familiar `case_when()`-style formula interface for easy interactive use, but also have `from` and `to` arguments as a way for you to incorporate a pre-built lookup table, making them more holistic replacements for both `case_match()` and `recode()`.
1313

14-
This work is a result of [Tidyup 7: Recoding and replacing values in the tidyverse](https://github.com/tidyverse/tidyups/blob/main/007-tidyverse-recoding-and-replacing.md), with a lot of great [feedback](https://github.com/tidyverse/tidyups/pull/29) from the community (#7728).
14+
This work is a result of [Tidyup 7: Recoding and replacing values in the tidyverse](https://github.com/tidyverse/tidyups/blob/main/007-tidyverse-recoding-and-replacing.md), with a lot of great [feedback](https://github.com/tidyverse/tidyups/pull/29) from the community (#7728, #7729).
1515

1616
* In `case_when()`, supplying all size 1 LHS inputs along with a size >1 RHS input is now soft-deprecated. This is an improper usage of `case_when()` that should instead be a series of if statements, like:
1717

R/case-when.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
#' For `replace_when()`, an updated version of `x`, with the same size, type,
7575
#' and names as `x`.
7676
#'
77+
#' @seealso [recode_values()]
78+
#'
7779
#' @name case-and-replace-when
7880
#'
7981
#' @examples

0 commit comments

Comments
 (0)