Learn R Programming

cumplyr (version 0.1-1)

cartesian_product: Compute the Cartesian product of named variables.

Description

Compute the Cartesian product of named variables.

Usage

cartesian_product(variable.names, envir = parent.frame())

Arguments

variable.names
Character vector of names of variables
envir
The environment in which to find names

Value

Examples

Run this code
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)

Run the code above in your browser using DataLab