lzipper: Takes a list of lists, and applies a function to the...

lzipperR Documentation

Takes a list of lists, and applies a function to the combination of each inner element from each outer list.

Description

eg: str(lol) List of 2 $ A:List of 3 ..$ A1: chr "a1" ..$ A2: chr "a2" ..$ A3: chr "a3" $ B:List of 3 ..$ B1: chr "b1" ..$ B2: chr "b2" ..$ B3: chr "b3"

Usage

lzipper(lol, .FUN, ...)

Arguments

lol

list of lists. Each inner list should have the same number of elements

.FUN

function

...

additional arguments to .FUN

Details

.FUN is supplied the elements A1,B1 and then called again with A2,B2, and then A3,B3

The result of zipper(lol, c) is:

List of 3 $ A1:List of 2 ..$ A: chr "a1" ..$ B: chr "b1" $ A2:List of 2 ..$ A: chr "a2" ..$ B: chr "b2" $ A3:List of 2 ..$ A: chr "a3" ..$ B: chr "b3"

zipper(lol, c) is the same as the Lisp operation zip:

(zip '(a1 a2 a3) '(b1 b2 b3) => ((a1 b1) (a2 b2) (a3 b3))

Value

a list of the results from applying .FUN to each combination


kcha193/simarioV2 documentation built on April 8, 2024, 4:51 p.m.