InflMat-class | R Documentation |
Functions and methods calculate and manipulate graph influence matrix.
InflMat(x)
## S3 method for class 'InflMat'
print(x, ...)
## S3 method for class 'InflMat'
nedge(x)
## S3 method for class 'InflMat'
edge(x)
## S3 replacement method for class 'InflMat'
edge(x) <- value
## S3 method for class 'InflMat'
edgenames(x)
## S3 replacement method for class 'InflMat'
edgenames(x) <- value
x |
A |
... |
Further arguments to be passed internally to other functions or methods. |
value |
A vector or |
The returned value depends on the function:
A binary influence matrix of the graph with as many rows as its number of vertices and as many columns as its number of edges.
InflMat()
: Influence Matrix
Calculates the influence matrix of a phylogenetic graph. The influence matrix is a binary matrix whose rows and columns correspond to the vertices and edges of the phylogenetic graph, respectively, and whose elements describe whether a given edge had been taken by any ancestors of a vertex (representing extinct of extant species) during evolution (value = 1) or not (value = 0).
print(InflMat)
: Print Graph
A print method for InflMat-class
objects.
nedge(InflMat)
: Number of Edges
Get the number of edges in an InflMat-class
object.
edge(InflMat)
: Edge Extraction
Extracts the edges of an InflMat-class
object.
edge(InflMat) <- value
: Edge Assignment
Assigns edges to an InflMat-class
object.
edgenames(InflMat)
: Edge Names Extraction
Extracts the edge names of an InflMat-class
object.
edgenames(InflMat) <- value
: Edge Names Assignment
Assigns edge names to an InflMat-class
object.
Guillaume Guénard [aut, cre] (<https://orcid.org/0000-0003-0761-3072>), Pierre Legendre [ctb] (<https://orcid.org/0000-0002-3838-3305>) – Maintainer: Guillaume Guénard <guillaume.guenard@umontreal.ca>
Guénard, G., Legendre, P., and Peres-Neto, P. 2013. Phylogenetic eigenvector maps: a framework to model and predict species traits. Methods in Ecology and Evolution. 4: 1120–1131
Makarenkov, V., Legendre, L. & Desdevise, Y. 2004. Modelling phylogenetic relationships using reticulated networks. Zoologica Scripta 33: 89–96
Blanchet, F. G., Legendre, P. & Borcard, D. 2008. Modelling directional spatial processes in ecological data. Ecological Modelling 215: 325–336
PEM-class
PEM-functions
## Exemplary graph:
data.frame(
species = as.logical(c(0,0,1,0,0,0,0,0,0,0,1,1,1)),
type = c(2,2,3,1,2,2,2,2,2,2,3,3,3),
x = c(1,3,4,0,1.67,4,1,1.33,2.33,3.33,4.33,4,5),
y = c(1,1,1,0,0.5,0,-1,0,0,-0.5,-1,-0.5,-0.5),
row.names = sprintf("V%d",1:13)
) %>%
st_as_sf(
coords=c("x","y"),
crs = NA
) %>%
graph %>%
add.edge(
from = c(1,2,1,5,4,4,5,9,4,8,9,4,7,7,6,6,9,10,10),
to = c(2,3,5,2,1,5,9,2,8,9,6,7,8,9,3,13,10,12,11),
data = data.frame(
distance = c(4.2,4.7,3.9,3.0,3.6,2.7,4.4,3.4,3.6,3.3,
4.8,3.2,3.5,4.4,2.5,3.4,4.3,3.1,2.2),
row.names = sprintf("E%d",1:19)
)
) -> x
## Calculation of the influence matrix:
y <- InflMat(x)
## Obtain the number of edges:
nedge(y)
## Obtain the edge names:
edgenames(y)
## Obtain the edge data frame:
edge(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.