residuals_paco {paco}R Documentation

Return Procrustes residuals from a paco object

Description

Takes the Procrustes object from vegan::procrustes of the global superimpostion and pulls out either the residual matrix of superimposition or the residual of each individual interaction (link between host and parasite).

Usage

residuals_paco(object, type = "interaction")

Arguments

object

An obejct of class procrustes as returned from PACo (and internally the vegan::procrustes function). In a PACo output this is D\$proc.

type

Character string. Whether the whole residual matrix (matrix) or the residuals per interaction (interaction) is desired.

Value

If type=interaction, a named vector of the Procrustes residuals is returned where names are the interactions. If type=matrix, a matrix of residuals from Procrustes superimposition is returned.

Examples

data(gopherlice)
library(ape)
gdist <- cophenetic(gophertree)
ldist <- cophenetic(licetree)
D <- prepare_paco_data(gdist, ldist, gl_links)
D <- add_pcoord(D, correction='cailliez')
D <- PACo(D, nperm=100, seed=42, method='r0')
residuals_paco(D$proc)

[Package paco version 0.4.2 Index]