Description Usage Arguments Value Examples
Compute the Cartesian product of named variables.
1 | cartesian_product(variable.names, envir = parent.frame())
|
variable.names |
Character vector of names of variables |
envir |
The environment in which to find names |
The Cartesian product of all variables
1 2 3 4 5 6 7 8 9 | library('cumplyr')
x <- 1:2
y <- 10:11
cartesian_product(c('x', 'y'))
tmp.env <- new.env()
assign('x', 1:3, envir = tmp.env)
assign('y', 2:4, envir = tmp.env)
cartesian_product(c('x', 'y'), envir = tmp.env)
|
x y
1 1 10
2 1 11
3 2 10
4 2 11
x y
1 1 2
2 1 3
3 1 4
4 2 2
5 2 3
6 2 4
7 3 2
8 3 3
9 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.