map2: Bivariate Lapply with Custom Return Type

View source: R/tools.R

map2R Documentation

Bivariate Lapply with Custom Return Type

Description

Bivariate Lapply with Custom Return Type

Usage

map2(x, y, f, output_type = "list")

Arguments

x, y

A couple of vectors or lists with the same size

f

A function

output_type

The desired return type. Should be one of "list" (the default), "integer", "numeric" or "character".

Value

A list (if output_type = "list") or a vector, sharing names with x, built by applying f to each element of x and y simultaneously. This is a rough implementation of the map2 function from the purrr package purrr aims at removing the dependency from that package.


WH documentation built on Sept. 11, 2024, 9:12 p.m.