Learn R Programming

reshape (version 0.8.10)

expand.grid.df: Expand grid

Description

Expand grid of data frames

Usage

expand.grid.df(..., unique=TRUE)

Author

Hadley Wickham <h.wickham@gmail.com>

Arguments

...

list of data frames (first varies fastest)

unique

only use unique rows?

Details

Creates new data frame containing all combination of rows from data.frames in ...

Examples

Run this code
expand.grid.df(data.frame(a=1,b=1:2))
expand.grid.df(data.frame(a=1,b=1:2), data.frame())
expand.grid.df(data.frame(a=1,b=1:2), data.frame(c=1:2, d=1:2))
expand.grid.df(data.frame(a=1,b=1:2), data.frame(c=1:2, d=1:2), data.frame(e=c("a","b")))

Run the code above in your browser using DataLab