expand.grid.jc: An even faster version of expand.grid

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_basics_v1.R

Description

This should be faster than expand.grid, which "[c]reate[s] a data frame from all combinations of the supplied vectors or factors" (R documentation).

Usage

1
  expand.grid.jc(seq1, seq2)

Arguments

seq1

A sequence of elements

seq2

A sequence of elements

Details

The source of this function was this discussion thread: http://stackoverflow.com/questions/10405637/use-outer-instead-of-expand-grid

Value

matrix_of_combinations A matrix of all the possible combinations.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

convolve, expand.grid, expand.grid.jc

Examples

1
2
3
4
5
6
testval=1
seq1 = c("A","B","C")
seq2 = seq1
expand.grid(seq1,seq2)
expand.grid.alt(seq1,seq2)
expand.grid.jc(seq1,seq2)

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.

Search within the BioGeoBEARS package
Search all R packages, documentation and source code