node.similarity: calculate pair similarity of nodes based on the nodes'...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/loop.R

Description

The pair similarity of nodes is defined as the exterior nodes shared by both focused nodes (i.e., there must be links between the focused nodes and the exterior nodes)

Usage

1
node.similarity(gemat, type = "both", metric = "jaccard")

Arguments

gemat

standard square graph matrix

type

if type="both", the node similarity is calculated based on the the vertex similarity from the inward/outward links for each pair of nodes. if type="in", the node similarity is calculated based on the the vertex similarity from the inward links for each pair of nodes. if type="out", the node similarity is calculated based on the the vertex similarity from the outward links for each pair of nodes.

metric

node similarity methods, currently supporting two basic similarity indices: "jaccard" and "sorensen".

Value

will return a symmetric similarity matrices

Author(s)

Youhua Chen <haydi@126.com>

References

Chen Y (2012) loop: an R package for performing decomposition of weighted directed graphs, food web analysis and flexible network plotting. Submitted.

See Also

nmds.ordination

Examples

1
2
3
4
5
mat=matrix(c(0,5,3,7,0,5,0,0,0,4,3,8,0,1,0,7,0,1,0,0,0,4,6,2,0),5,5)
#compare the differences for each type of links
node.similarity(gemat=mat,type="in")
node.similarity(gemat=mat,type="out")
node.similarity(gemat=mat,type="both")

loop documentation built on May 2, 2019, 9:07 a.m.