residuals_paco: Return Procrustes residuals from a paco object

Description Usage Arguments Value Examples

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

1
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

1
2
3
4
5
6
7
8
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)

Example output

There were 50 or more warnings (use warnings() to see the first 50)
 Ound-Gset  Ocav-Gpan  Oche-Gche  Ohet-Gcos  Ohis-Gcha GburB-Ggeo GburA-Gokl 
0.04740129 0.04976048 0.04016673 0.03812147 0.04378583 0.02700916 0.02529977 
 Gbre-Gewi Gpers-Gtex  Ccas-Gexp  Tbot-Gact Cmer-Gpero  Ttal-Gtho  Ztri-Gtri 
0.05593318 0.05003108 0.04876865 0.11335455 0.05684718 0.08996408 0.05191354 
 Pbul-Gnad  Tbot-Tmin  Ttal-Tbar 
0.02482918 0.10680919 0.12299913 

paco documentation built on Aug. 26, 2020, 1:06 a.m.