HOasso {HOasso} | R Documentation |
Evalutes Higer Order Assortativity of complex networks
Description
The function evalutes Higer Order Assortativity of complex networks represented by objects of class igraph
from the package of the same name.
Usage
HOasso(
g,
h = 1,
weighted = is.weighted(g),
x = c("sout", "dout", "lout", "sin", "din", "lin"),
y = c("sin", "din", "lin", "sout", "dout", "lout")
)
## S3 method for class 'assortativity'
plot(x,
type = "h",
ylim = c(-1, 1),
xlab = "Orders",
ylab = "Assortativity",
...
)
## S3 method for class 'assortativity'
print(x, ...)
Arguments
g |
an object of class |
h |
an integer value, the function will evaluates the assortativity from the order 1 to the order |
weighted |
|
x |
In case of the |
y |
The second centrarlity measure, in-strength by default, see |
type |
Type of plot, histogram-like vertical lines by default. |
xlab |
A label for the x axis, |
ylab |
A label for the x axis, |
ylim |
The y limits of the plot, the assortativity index can assume only values between -1 and 1. |
... |
Other arguments of the |
Details
Arguments x
and y are character
objects and can assume values "sout"
, "dout"
, "lout"
, "sin"
, "din"
, "lin"
representing the out-strength, out-degree, out-log-strength, in-strength, in-degree, and in-log-strength respectively.
In case of undirected graphs in- and out- centrality measures are equal. In case of unweighted graphs the strength is equal to the degree.
The function returns an object of class assortativity
subclass of a numeric
vector.
plot.assortativity
is identical to plot.default
but with different defaults in order to get a plot coherent with the assortativity index.
print.assortativity
is a method to show the assortativity values and the order side by syde.
Value
A vector h
long containing the assortativity measures from the order 1 to the order h
.
References
Arcagni A, Grassi R, Stefani S, Torriero A (2017). “Higher order assortativity in complex networks.” European Journal of Operational Research, 262(2), 708–719. doi:10.1016/j.ejor.2017.04.028.
Arcagni A, Grassi R, Stefani S, Torriero A (2021). “Extending assortativity: An application to weighted social networks.” Journal of Business Research, 129, 774–783. doi:10.1016/j.jbusres.2019.10.008.
Arcagni A, Cerqueti R, Grassi R (2023). “Higher order assortativity for directed weighted networks and Markov chains.” arXiv preprint arXiv:2304.01737. doi:10.48550/arXiv.2304.01737.
Examples
g <- graph_from_data_frame(data.frame(
from = c("i", "j", "j", "k", "l"),
to = c("k", "k", "l", "l", "i"),
weight = c( 10, 5, 2, 3, 2 )
))
E(g)$label <- E(g)$weight
a <- HOasso(g, h = 10)
print(a)
plot(a, lwd = 3, panel.first = abline(h = 0, lty = 2))