remove_null_rowcols_from_mat: Remove rows or columns representing a null geographic range...

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

View source: R/BioGeoBEARS_basics_v1.R

Description

This function removes rows or columns representing a null geographic range from a matrix.

Usage

1
  remove_null_rowcols_from_mat(tmpmat, null_sym = "()")

Arguments

tmpmat

The matrix to check for null ranges. Function will only work if rows and columns have names, and one of the names matches null_sym.

null_sym

The character(s) denoting a null range.

Details

LAGRANGE (Ree et al. (2008)) and other models often assume that a null geographic range (the lineage inhabits no areas, i.e. is extinct) is a possible state. However, this is never a possible ancestral state (since an extinct lineage will never have descendants) so sometimes we must remove it.

Value

tmpmat3 The revised matrix.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/

ReeSmith2008

Matzke_2012_IBS

See Also

areas_list_to_states_list_new, areas_list_to_states_list_old, make_relprob_matrix_de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
testval=1
states_list = list("_", c("A"), c("B"), c("C"), c("A","B"),
c("B","C"), c("A","C"), c("A","B","C"))

states_list = areas_list_to_states_list_new(areas=c("A","B","C"),
include_null_range=TRUE, split_ABC=TRUE)
states_list

dedf = make_relprob_matrix_de(states_list=states_list,
split_ABC=FALSE, split="", remove_simultaneous_events=TRUE,
add_multiple_Ds=TRUE,
dispersal_multiplier_matrix=make_dispersal_multiplier_matrix(states_list=states_list))

spmat_noNulls = remove_null_rowcols_from_mat(tmpmat=dedf, null_sym="()")
spmat_noNulls

spmat_noNulls = remove_null_rowcols_from_mat(tmpmat=dedf, null_sym="_")
spmat_noNulls

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