Skip to content

Commit 06f5098

Browse files
SoyAndreahadley
andauthored
Correct documentation for pmap (#1143)
Fixes #1124 --------- Co-authored-by: SoyAndrea <[email protected]> Co-authored-by: Hadley Wickham <[email protected]>
1 parent 7dea85a commit 06f5098

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

R/pmap.R

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,25 @@
2323
#' * A formula, e.g. `~ ..1 + ..2 / ..3`. This syntax is not recommended as
2424
#' you can only refer to arguments by position.
2525
#' @inheritParams map
26-
#' @inherit map return
26+
#' @returns
27+
#' The output length is determined by the maximum length of all elements of `.l`.
28+
#' The output names are determined by the names of the first element of `.l`.
29+
#' The output type is determined by the suffix:
30+
#'
31+
#' * No suffix: a list; `.f()` can return anything.
32+
#'
33+
#' * `_lgl()`, `_int()`, `_dbl()`, `_chr()` return a logical, integer, double,
34+
#' or character vector respectively; `.f()` must return a compatible atomic
35+
#' vector of length 1.
36+
#'
37+
#' * `_vec()` return an atomic or S3 vector, the same type that `.f` returns.
38+
#' `.f` can return pretty much any type of vector, as long as it is length 1.
39+
#'
40+
#' * `pwalk()` returns the input `.l` (invisibly). This makes it easy to
41+
#' use in a pipe. The return value of `.f()` is ignored.
42+
#'
43+
#' Any errors thrown by `.f` will be wrapped in an error with class
44+
#' [purrr_error_indexed].
2745
#' @family map variants
2846
#' @export
2947
#' @examples

man/pmap.Rd

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

0 commit comments

Comments
 (0)