lzipper | R Documentation |
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"
lzipper(lol, .FUN, ...)
lol |
list of lists. Each inner list should have the same number of elements |
.FUN |
function |
... |
additional arguments to .FUN |
.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))
a list of the results from applying .FUN to each combination
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.