From c1c42adb8bf0c069dabe61b437d604917d734cfa Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 20 Aug 2024 15:36:06 -0500 Subject: [PATCH] Document a few more differences --- R/pmap.R | 8 ++++---- man/pmap.Rd | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/R/pmap.R b/R/pmap.R index da9cdf2f..841818bc 100644 --- a/R/pmap.R +++ b/R/pmap.R @@ -24,8 +24,8 @@ #' you can only refer to arguments by position. #' @inheritParams map #' @returns -#' The output length is determined by the length of the input. -#' The output names are determined by the names of the first element. +#' 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. @@ -35,9 +35,9 @@ #' 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 its length 1. +#' `.f` can return pretty much any type of vector, as long as it is length 1. #' -#' * `walk()` returns the input `.x` (invisibly). This makes it easy to +#' * `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 diff --git a/man/pmap.Rd b/man/pmap.Rd index 6cc99324..65babeef 100644 --- a/man/pmap.Rd +++ b/man/pmap.Rd @@ -67,8 +67,8 @@ of the elements of the result. Otherwise, supply a "prototype" giving the desired type of output.} } \value{ -The output length is determined by the length of the input. -The output names are determined by the names of the first element. +The output length is determined by the maximum length of all elements of \code{.l}. +The output names are determined by the names of the first element of \code{.l}. The output type is determined by the suffix: \itemize{ \item No suffix: a list; \code{.f()} can return anything. @@ -76,8 +76,8 @@ The output type is determined by the suffix: or character vector respectively; \code{.f()} must return a compatible atomic vector of length 1. \item \verb{_vec()} return an atomic or S3 vector, the same type that \code{.f} returns. -\code{.f} can return pretty much any type of vector, as long as its length 1. -\item \code{walk()} returns the input \code{.x} (invisibly). This makes it easy to +\code{.f} can return pretty much any type of vector, as long as it is length 1. +\item \code{pwalk()} returns the input \code{.l} (invisibly). This makes it easy to use in a pipe. The return value of \code{.f()} is ignored. }