Skip to contents

[Deprecated]

get.adjacency() was renamed to as_adjacency_matrix() to create a more consistent API.

Usage

get.adjacency(
  graph,
  type = c("both", "upper", "lower"),
  attr = NULL,
  edges = FALSE,
  names = TRUE,
  sparse = igraph_opt("sparsematrices")
)

Arguments

graph

The graph to convert.

type

Gives how to create the adjacency matrix for undirected graphs. It is ignored for directed graphs. Possible values: upper: the upper right triangle of the matrix is used, lower: the lower left triangle of the matrix is used. both: the whole matrix is used, a symmetric matrix is returned.

attr

[Deprecated] Use weights instead. If supplied, the value is forwarded to weights as a character edge attribute name.

edges

[Deprecated] Logical, whether to return the edge IDs in the matrix. For non-existant edges zero is returned.

names

Logical, whether to assign row and column names to the matrix. These are only assigned if the name vertex attribute is present in the graph.

sparse

Logical, whether to create a sparse matrix. The ‘Matrix’ package must be installed for creating sparse matrices.

get_adjacency(), get_adjacency_sparse(), vcount(), edges(), get_eids(), ecount()