Similar to expand.grid function, this function creates all combinations of the input arguments but returns the result as a list.

expand.list(...)

Arguments

...

input variables

Value

list

Author

Klaus Kähler Holst

Examples

expand.list(x=2:4, z=c("a","b"))
#> [[1]]
#> [[1]]$x
#> [1] 2
#> 
#> [[1]]$z
#> [1] "a"
#> 
#> 
#> [[2]]
#> [[2]]$x
#> [1] 3
#> 
#> [[2]]$z
#> [1] "a"
#> 
#> 
#> [[3]]
#> [[3]]$x
#> [1] 4
#> 
#> [[3]]$z
#> [1] "a"
#> 
#> 
#> [[4]]
#> [[4]]$x
#> [1] 2
#> 
#> [[4]]$z
#> [1] "b"
#> 
#> 
#> [[5]]
#> [[5]]$x
#> [1] 3
#> 
#> [[5]]$z
#> [1] "b"
#> 
#> 
#> [[6]]
#> [[6]]$x
#> [1] 4
#> 
#> [[6]]$z
#> [1] "b"
#> 
#> 
#> attr(,"table")
#>   x z
#> 1 2 a
#> 2 3 a
#> 3 4 a
#> 4 2 b
#> 5 3 b
#> 6 4 b