Skip to contents

Apply functions to elements of a vector

Usage

map(x, fun, ..., .if, .at)

map_chr(x, fun, ..., .if, .at)

map_int(x, fun, ..., .if, .at)

map_dbl(x, fun, ..., .if, .at)

map_df(x, fun, ..., .if, .at)

Arguments

x

A data object.

fun

A function.

...

Additional arguments to pass to fun.

.if

A logical vector the same length as x or a function that will evaluate to a logical vector the same length as x. Elements that are TRUE will have fun applied to them.

.at

A character vector of names to apply fun to.

Value

data.frame

Examples

#----------------------------------------------------------------------------
# map*() examples
#----------------------------------------------------------------------------
library(bkdat)