Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/BioGeoBEARS_basics_v1.R
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).
1 | expand.grid.alt(seq1, seq2)
|
seq1 |
A sequence of elements |
seq2 |
A sequence of elements |
The source of this function was this discussion thread: http://stackoverflow.com/questions/10405637/use-outer-instead-of-expand-grid
matrix_of_combinations
A matrix of all the
possible combinations.
Go BEARS!
Nicholas J. Matzke matzke@berkeley.edu
http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster
Matzke_2012_IBS
convolve
, expand.grid
,
expand.grid.jc
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)
|
Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase
Attaching package: 'phylobase'
The following object is masked from 'package:ape':
edges
Var1 Var2
1 A A
2 B A
3 C A
4 A B
5 B B
6 C B
7 A C
8 B C
9 C C
[,1] [,2]
[1,] "A" "A"
[2,] "B" "A"
[3,] "C" "A"
[4,] "A" "B"
[5,] "B" "B"
[6,] "C" "B"
[7,] "A" "C"
[8,] "B" "C"
[9,] "C" "C"
Var1 Var2
[1,] "A" "A"
[2,] "B" "A"
[3,] "C" "A"
[4,] "A" "B"
[5,] "B" "B"
[6,] "C" "B"
[7,] "A" "C"
[8,] "B" "C"
[9,] "C" "C"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.