Learn R Programming

ggloop (version 0.1.0)

expand.grid2: A new version of an old favorite with some extra options

Description

expand.grid2() creates a combination data frame from vectors or lists but differs from the original expand.grid() in that it has two options for removing two different type of duplicates. stringsAsFactors is set to TRUE.

Usage

expand.grid2(..., rm.dupes = TRUE, rm.dubs = TRUE)

Arguments

...
Vectors to be expanded.
rm.dupes
Removes duplicated "rows". If TRUE (default) then rows that are unordered duplicates of other rows will be removed. i.e. c("A", "B", "C") is the same as c("C", "B", "A") and any other combination of "A", "B", and "C".
rm.dubs
Removes a row in which all elements are the same. If TRUE (default) then a row such as c("A", "A", "A") will be removed.