Skip to content

Commit

Permalink
Correct documentation for pmap (#1143)
Browse files Browse the repository at this point in the history
Fixes #1124

---------

Co-authored-by: SoyAndrea <[email protected]>
Co-authored-by: Hadley Wickham <[email protected]>
  • Loading branch information
3 people authored Aug 20, 2024
1 parent 7dea85a commit 06f5098
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
20 changes: 19 additions & 1 deletion R/pmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,25 @@
#' * A formula, e.g. `~ ..1 + ..2 / ..3`. This syntax is not recommended as
#' you can only refer to arguments by position.
#' @inheritParams map
#' @inherit map return
#' @returns
#' The output length is determined by the maximum length of all elements of `.l`.
#' The output names are determined by the names of the first element of `.l`.
#' The output type is determined by the suffix:
#'
#' * No suffix: a list; `.f()` can return anything.
#'
#' * `_lgl()`, `_int()`, `_dbl()`, `_chr()` return a logical, integer, double,
#' or character vector respectively; `.f()` must return a compatible atomic
#' vector of length 1.
#'
#' * `_vec()` return an atomic or S3 vector, the same type that `.f` returns.
#' `.f` can return pretty much any type of vector, as long as it is length 1.
#'
#' * `pwalk()` returns the input `.l` (invisibly). This makes it easy to
#' use in a pipe. The return value of `.f()` is ignored.
#'
#' Any errors thrown by `.f` will be wrapped in an error with class
#' [purrr_error_indexed].
#' @family map variants
#' @export
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions man/pmap.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 06f5098

Please sign in to comment.