The generic parallel function par_lapply() can only apply a function with single parameter to a list. Thus function with multiple parameters need to be wrapped into a function with single parameter list.

align_lists(...)

Arguments

...

multiple lists with same length, to be combined into a master list with item from each list aligned

Value

A list of same length of each input list, and each input parameter should have same length. Each item in result is a list of each ith item in input lists.

Examples

align_lists(letters[1:3], 1:3, rep_len(FALSE, length.out = 3))
#> [[1]] #> [[1]][[1]] #> [1] "a" #> #> [[1]][[2]] #> [1] 1 #> #> [[1]][[3]] #> [1] FALSE #> #> #> [[2]] #> [[2]][[1]] #> [1] "b" #> #> [[2]][[2]] #> [1] 2 #> #> [[2]][[3]] #> [1] FALSE #> #> #> [[3]] #> [[3]][[1]] #> [1] "c" #> #> [[3]][[2]] #> [1] 3 #> #> [[3]][[3]] #> [1] FALSE #> #>