reducedConnMat: Reduced connectivity matrix according to a set of...

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

View source: R/jacobi_etal_2012.R

Description

Reduces a connectivity matrix based on a set of subpopulations. If there are N subpopulations, then the reduced matrix will have dimensions NxN. The reduced matrix will be ordered according to the order of subpopulations in subpops.lst.

Usage

1
reducedConnMat(subpops.lst, conn.mat)

Arguments

subpops.lst

A list whose elements are vectors of indices for each subpopulation. If a vector of integers is given, then subpopsVectorToList is applied to convert it to a list of subpopulations.

conn.mat

A square connectivity matrix.

Value

A reduced connectivity matrix. The sum of all elements of this reduced connectivity matrix will be equal to the sum of all elements of the original connectivity matrix.

Author(s)

David M. Kaplan dmkaplan2000@gmail.com

References

Jacobi, M. N., Andre, C., Doos, K., and Jonsson, P. R. 2012. Identification of subpopulations from connectivity matrices. Ecography, 35: 1004-1016.

See Also

See also qualitySubpops

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(ConnMatTools)
data(chile.loco)

num <- prod(dim(chile.loco)) / sum(chile.loco)
betas <- betasVectorDefault(n=num,steps=4)
chile.loco.split <- optimalSplitConnMat(chile.loco,normalize.cols=FALSE,
                                        betas=betas)

# Extra 3rd division
print(paste("Examining split with",names(chile.loco.split$best.splits)[1],
            "subpopulations."))
pops <- subpopsVectorToList(chile.loco.split$subpops[,chile.loco.split$best.splits[[1]]$index])

reduce.loco <- reducedConnMat(pops,chile.loco)

sr <- selfRecruitment(reduce.loco)
lr <- localRetention(reduce.loco)
rlr <- relativeLocalRetention(reduce.loco)

dmkaplan2000/ConnMatTools documentation built on Feb. 8, 2020, 4:41 p.m.