Learn R Programming

cograph (version 2.7.2)

edge_reciprocity: Edge Reciprocity

Description

Convenience wrapper around edge_centrality that returns only reciprocity information for directed networks.

Usage

edge_reciprocity(x, top = NULL, directed = NULL, digits = NULL, ...)

Value

A data frame with one row per directed edge and columns from, to, weight, reciprocated (logical), reverse_weight (NA when not reciprocated) and weight_ratio

(weight / reverse_weight; NA when not reciprocated). Rows are ordered with reciprocated edges first, then by |weight_ratio|

descending.

Arguments

x

Network input: matrix, igraph, network, cograph_network, or tna object.

top

Integer or NULL. Return only the top N edges. Default NULL.

directed

Logical or NULL. Default NULL (auto-detect).

digits

Integer or NULL. Round numeric columns. Default NULL.

...

Additional arguments passed to edge_centrality.

Errors

Raises an error when the resolved network is undirected: reciprocity is only defined for directed edges.

See Also

edge_centrality

Examples

Run this code
adj <- matrix(c(0, 0.8, 0, 0.3, 0, 0.5, 0.7, 0, 0), 3, 3, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
cograph::edge_reciprocity(adj, directed = TRUE)

Run the code above in your browser using DataLab