Learn R Programming

BioGeoBEARS (version 0.2.1)

paste_rows_without_zeros: Concatenate cells in each row of a text-based transition matrix, excluding zeros

Description

This is a utility function for make_relprob_txtmatrix_sp1.

Usage

paste_rows_without_zeros(tmpmat)

Arguments

tmpmat
A cladogenesis/speciation probability matrix (text-based) to collapse each row of.

Value

tmpcol A list containing each row, concatenated

Details

Convert e.g.: A|A A|B A|C A|A,B A|B,C A|A,C A|A,B,C A s j j 0 0 0 0 B 0 j 0 0 0 0 0 C 0 0 j 0 0 0 0 A,B 0 v 0 b1 0 0 0 B,C 0 0 0 0 j 0 0 A,C 0 0 v 0 0 b1 0 A,B,C 0 0 0 0 v 0 b1 ...to... A B C A,B B,C A,C A,B,C "s+j+j" "j" "j" "v+b1" "j" "v+b1" "v+b1"

References

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

Matzke_2012_IBS

See Also

make_relprob_txtmatrix_sp1

Examples

Run this code
testval=1

spmat = make_relprob_matrix_bi(states_list=list("_", c("A"),
c("B"), c("C"), c("A","B"), c("B","C"), c("A","C"), c("A","B","C")),
split_ABC=FALSE, splitval="", code_for_overlapping_subsets=NA, printwarn=1)
spmat
tmpcol = paste_rows_without_zeros(tmpmat=spmat)
tmpcol

Run the code above in your browser using DataLab