pmap_lgl.: Apply a function to each element of a vector or list

View source: R/purrr-pmap.R

pmap_lgl.R Documentation

Apply a function to each element of a vector or list

Description

The map functions transform their input by applying a function to each element and returning a list/vector/data.table.

  • map() returns a list

  • ⁠_lgl()⁠, ⁠_int⁠, ⁠_dbl⁠,⁠_chr⁠, ⁠_df⁠ variants return their specified type

  • ⁠_dfr⁠ & ⁠_dfc⁠ Return all data frame results combined utilizing row or column binding

Usage

pmap_lgl.(.l, .f, ...)

Arguments

.l

A list to use in pmap

.f

A function

...

Other arguments to pass to a function

Examples

map(c(1,2,3), ~ .x + 1)

map_dbl(c(1,2,3), ~ .x + 1)

map_chr(c(1,2,3), as.character)

tidytable documentation built on Oct. 5, 2023, 5:07 p.m.