PACo {paco} | R Documentation |
Performs PACo analysis.
Description
Two sets of Principal Coordinates are superimposed by Procrustes superimposition. The sum of squared residuals of this superimposition give an indication of how congruent the two datasets are. For example, in a biological system the two sets of Principal Coordinates can be composed from the phylogenetic distance matrices of two interacting groups. The congruence measured by PACo indicates how concordant the two phylogenies are based on observed ecological interactions between them.
Usage
PACo(
D,
nperm = 1000,
seed = NA,
method = "r0",
symmetric = FALSE,
proc.warnings = TRUE,
shuffled = FALSE
)
Arguments
D |
A list of class |
nperm |
The number of permutations to run. In each permutation, the network is randomized following the |
seed |
An integer with which to begin the randomizations. If the same seed is used the randomizations will be the same and results reproducible. If |
method |
The method with which to permute association matrices: "r0", "r1", "r2", "c0", "swap", "quasiswap", "backtrack", "tswap", "r00". Briefly, "r00" produces the least conservative null model as it only maintains total fill (i.e., total number of interactions). "r0" and "c0" maintain the row sums and column sums, respectively, as well as the total number of interactions. "backtracking" and any of the "swap" algorithms conserve the total number of interactions in the matrix, as well as both row and column sums. Finally, "r1" and "r2" conserve the row sums, the total number of interactions, and randomize based on observed interaction frequency. See |
symmetric |
Logical. Whether or not to use the symmetric Procrustes statistic, or not. When |
proc.warnings |
Logical. Make any warnings from the Procrustes superimposition callable. If |
shuffled |
Logical. Return the Procrustes sum of squared residuals for every permutation of the network. When |
Value
A paco
object that now includes (alongside the Principal Coordinates and input distance matrices) the PACo sum of sqaured residuals, a p-value for this statistic, and the PACo statistics for each randomisation of the network if shuffled=TRUE in the PACo call.
Note
Any call of PACo in which the distance matrices have differing dimensions (i.e., different numbers of tips of the two phylogenies) will produce warnings from the vegan::procrustes
function. These warnings require no action by the user but are merely letting the user know that, as the distance matrices had differing dimensions, their Principal Coordinates have differing numbers of columns. vegan::procrustes
deals with this internally by adding columns of zeros to the smaller of the two until the are the same size.
Examples
data(gopherlice)
require(ape)
gdist <- cophenetic(gophertree)
ldist <- cophenetic(licetree)
D <- prepare_paco_data(gdist, ldist, gl_links)
D <- add_pcoord(D)
D <- PACo(D, nperm=10, seed=42, method="r0")
print(D$gof)