This function uses the igraph package to calculate
the component distribution from a adjacency matrix.
network_statistics_component_distribution(
adj_mat,
weighted = TRUE,
mode = "undirected",
diag = TRUE,
add_colnames = NULL,
add_rownames = NA,
...
)
Arguments
adj_mat |
a symmetrical adjacency matrix. |
weighted |
This argument specifies whether to create a weighted graph from an adjacency matrix.
If it is NULL then an unweighted graph is created and the elements of the adjacency matrix gives the number
of edges between the vertices. If it is a character constant then for every non-zero matrix entry
an edge is created and the value of the entry is added as an edge attribute named by the weighted argument. If it is TRUE then a weighted graph is created and the name of the edge attribute will be weight. See also details below. |
mode |
a character value specifying how igraph should interpret the input matrices.
Options are:
If weighted = NULL :
mode = "directed" : The graph will be directed and a matrix element gives the number of edges between two vertices.
mode = "undirected" : This is exactly the same as max, for convenience. Note that it is not checked whether the matrix is symmetric (default).
mode = "upper" : An undirected graph will be created, only the upper right triangle (including the diagonal) is used for the number of edges.
mode = "lower" : An undirected graph will be created, only the lower left triangle (including the diagonal) is used for creating the edges.
mode = "max" : An undirected graph will be created and max(A(i,j), A(j,i)) gives the number of edges.
mode = "min" : undirected graph will be created with min(A(i,j), A(j,i)) edges between vertex i and j.
mode = "plus" : undirected graph will be created with A(i,j)+A(j,i) edges between vertex i and j.
If the weighted argument is not NULL then the elements of the matrix give the weights of the edges (if they are not zero). The details depend on the value of the mode argument:
itemize
mode = "directed" : The graph will be directed and a matrix element gives the edge weights.
mode = "undirected" : First we check that the matrix is symmetric. It is an error if not. Then only the upper triangle is used to create a weighted undirected graph (default).
mode = "upper" : An undirected graph will be created, only the upper right triangle (including the diagonal) is used (for the edge weights).
mode = "lower" : An undirected graph will be created, only the lower left triangle (including the diagonal) is used for creating the edges.
mode = "max" : An undirected graph will be created and max(A(i,j), A(j,i)) gives the edge weights.
mode = "min" : An undirected graph will be created, min(A(i,j), A(j,i)) gives the edge weights.
mode = "plus" : An undirected graph will be created, A(i,j)+A(j,i) gives the edge weights.
|
diag |
a logical value specifying whether to include the diagonal of the matrix in the calculation. If diag = FALSE then the diagonal first set to zero and then passed along the downstream functions. |
add_colnames |
a character value specifying whether column names shall be added as vertex attributes. Options are:
add_colnames = NULL (default): if present, column names are added as vertex attribute ‘name’.
add_colnames = NA : column names will not be added.
add_colnames = "" : If a character constant is specified then it gives the name of the vertex attribute to add.
|
add_rownames |
a character value specifying whether to add the row names as vertex attributes. Possible values the same as the previous argument. By default row names are not added. If ‘add.rownames’ and ‘add.colnames’ specify the same vertex attribute, then the former is ignored. |
... |
additional arguments passed on to graph_from_adjacency_matrix . |
Author
Sergio Vasquez and Hajk-Georg Drost
Examples
#> It seems like your input matrix contains values of correlation coefficients range(-1,1). Please be aware that for negative values the absolute value will be taken before rescaling. We transformed all negative values to their absolute values.
#> [1] 0 0 0 0 0 0