Skip to content

Commit 0c0dab4

Browse files
luisDVAshikokuchuo
andauthored
Update mentions of formula in documentation (#1220)
* check mentions of formulas, specifiy backward compatibility * specificy R version for clarity * revert formula comments, note for readme * Completely remove lambda-formula mention * Revert some removed lines * Fix other-langs vignette * Revert readme --------- Co-authored-by: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com>
1 parent b566017 commit 0c0dab4

25 files changed

+47
-46
lines changed

R/adverb-safely.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#' @param .f A function to modify, specified in one of the following ways:
1414
#' * A named function, e.g. `mean`.
1515
#' * An anonymous function, e.g. `\(x) x + 1` or `function(x) x + 1`.
16-
#' * A formula, e.g. `~ .x + 1`. Only recommended if you require backward
17-
#' compatibility with older versions of R.
16+
#' * A formula, e.g. `~ .x + 1`. No longer recommended.
1817
#' @param otherwise Default value to use when an error occurs.
1918
#' @param quiet Hide errors (`TRUE`, the default), or display them
2019
#' as they occur?

R/detect.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#'
77
#' * A named function, e.g. `mean`.
88
#' * An anonymous function, e.g. `\(x) x + 1` or `function(x) x + 1`.
9-
#' * A formula, e.g. `~ .x + 1`. You must use `.x` to refer to the first
10-
#' argument. No longer recommended.
9+
#' * A formula, e.g. `~ .x + 1`. Use `.x` to refer to the first argument. No
10+
#' longer recommended.
1111
#' * A string, integer, or list, e.g. `"idx"`, `1`, or `list("idx", 1)` which
1212
#' are shorthand for `\(x) pluck(x, "idx")`, `\(x) pluck(x, 1)`, and
1313
#' `\(x) pluck(x, "idx", 1)` respectively. Optionally supply `.default` to
@@ -33,8 +33,7 @@
3333
#' 3:10 |> detect_index(is_even, .dir = "backward")
3434
#'
3535
#'
36-
#' # Since `.f` is passed to as_mapper(), you can supply a
37-
#' # lambda-formula or a pluck object:
36+
#' # Since `.f` is passed to as_mapper(), you can supply a pluck object:
3837
#' x <- list(
3938
#' list(1, foo = FALSE),
4039
#' list(2, foo = TRUE),
@@ -50,7 +49,13 @@
5049
#'
5150
#' # If you need to find all positions, use map_lgl():
5251
#' which(map_lgl(x, "foo"))
53-
detect <- function(.x, .f, ..., .dir = c("forward", "backward"), .default = NULL) {
52+
detect <- function(
53+
.x,
54+
.f,
55+
...,
56+
.dir = c("forward", "backward"),
57+
.default = NULL
58+
) {
5459
.f <- as_predicate(.f, ..., .mapper = TRUE)
5560
.dir <- arg_match0(.dir, c("forward", "backward"))
5661

R/imap.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
#' * A named function, e.g. `paste`.
1111
#' * An anonymous function, e.g. `\(x, idx) x + idx` or
1212
#' `function(x, idx) x + idx`.
13-
#' * A formula, e.g. `~ .x + .y`. You must use `.x` to refer to the
14-
#' current element and `.y` to refer to the current index.
15-
#' No longer recommended.
13+
#' * A formula, e.g. `~ .x + .y`. Use `.x` to refer to the current element and
14+
#' `.y` to refer to the current index. No longer recommended.
1615
#'
1716
#' `r lifecycle::badge("experimental")`
1817
#'

R/keep.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
#'
1616
#' * A named function, e.g. `is.character`.
1717
#' * An anonymous function, e.g. `\(x) all(x < 0)` or `function(x) all(x < 0)`.
18-
#' * A formula, e.g. `~ all(.x < 0)`. You must use `.x` to refer to the first
19-
#' argument). No longer recommended.
18+
#' * A formula, e.g. `~ all(.x < 0)`. Use `.x` to refer to the first argument.
19+
#' No longer recommended.
20+
#'
2021
#' @seealso [keep_at()]/[discard_at()] to keep/discard elements by name.
2122
#' @param ... Additional arguments passed on to `.p`.
2223
#' @export

R/map.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#'
2424
#' * A named function, e.g. `mean`.
2525
#' * An anonymous function, e.g. `\(x) x + 1` or `function(x) x + 1`.
26-
#' * A formula, e.g. `~ .x + 1`. You must use `.x` to refer to the first
26+
#' * A formula, e.g. `~ .x + 1`. Use `.x` to refer to the first
2727
#' argument. No longer recommended.
2828
#' * A string, integer, or list, e.g. `"idx"`, `1`, or `list("idx", 1)` which
2929
#' are shorthand for `\(x) pluck(x, "idx")`, `\(x) pluck(x, 1)`, and

R/map2.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#'
1111
#' * A named function.
1212
#' * An anonymous function, e.g. `\(x, y) x + y` or `function(x, y) x + y`.
13-
#' * A formula, e.g. `~ .x + .y`. You must use `.x` to refer to the current
13+
#' * A formula, e.g. `~ .x + .y`. Use `.x` to refer to the current
1414
#' element of `x` and `.y` to refer to the current element of `y`.
1515
#' No longer recommended.
1616
#'

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ There are two less obvious advantages:
7575

7676
* All `map()` functions work with `in_parallel()` to easily spread computation
7777
across multiple cores on your computer, or multiple machines over the network.
78+

man/auto_browse.Rd

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

man/detect.Rd

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

man/every.Rd

Lines changed: 2 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)