This function and all of its descriptions have been obtained from the igraph package. For a complete description if the function and its arguments try this: ?igraph::graph_from_adjacency_matrix
graph_from_adjacency_matrix(
adjmatrix,
mode = c("directed", "undirected", "max", "min", "upper", "lower", "plus"),
weighted = NULL,
diag = TRUE,
add.colnames = NULL,
add.rownames = NA
)
A square adjacency matrix. From igraph version 0.5.1 this can be a sparse matrix created with the Matrix package.
Character scalar, specifies how igraph should interpret the supplied matrix. See also the weighted argument, the interpretation depends on that too. Possible values are: directed, undirected, upper, lower, max, min, plus.
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.
Logical scalar, whether to include the diagonal of the matrix in the calculation. If this is FALSE then the diagonal is zerod out first.
Character scalar, whether to add the column names as vertex attributes. If it is <U+2018>NULL<U+2019> (the default) then, if present, column names are added as vertex attribute <U+2018>name<U+2019>. If <U+2018>NA<U+2019> then they will not be added. If a character constant, then it gives the name of the vertex attribute to add.
Character scalar, 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 <U+2018>add.rownames<U+2019> and <U+2018>add.colnames<U+2019> specify the same vertex attribute, then the former is ignored.
An igraph graph object.
graph_from_adjacency_matrix
for a complete description on this function
Other network_reconstruction functions:
graph_from_data_frame()
# NOT RUN {
MyData <- coexpression.adjacency
My_graph <- graph_from_adjacency_matrix(MyData)
# }
Run the code above in your browser using DataLab