expand_list | R Documentation |
Create a list from all combinations of the supplied vectors or lists.
expand_list(...)
... |
vectors or lists. All arguments must be named. |
A list containing one element for each combination of the supplied vectors and lists. The first factors vary fastest. The nested elements are labeled by the factors.
The function allows list elements to be vectors, functions, or NULL
.
If a vector element is supposed to be kept as a vector, use list()
.
Peter Solymos
expand.grid
b <- expand_list(
movement = c(0, 1, 2),
rint = list(c(0.5, 1, 1.5, Inf)), # in a list to keep as one
xy_fun = list(NULL, function(z) z))
b[[1]]
str(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.