More of a reproducible example, called a reprex would be helpful in attracting more answers. I'm going to assume that you are using the network
library, and not sna
or igraph
.
coworking.adjacency.matrix
is defined as a matrix
object, labelled with the same given names as columns and rows, with 1 indicating an edge and 0 indicating no edge.
The first thing you need to do is to create a network::network
object, which has the following signature
network(x, vertex.attr=NULL, vertex.attrnames=NULL, directed=TRUE,
hyper=FALSE, loops=FALSE, multiple=FALSE, bipartite = FALSE, ...)
Where x
is your coworking.adjacency.matrix
.
n <- network(coworking.adjacency.matrix)
gives you a network object, which contains the vertex name attributes in n$val
, and
network.vertex.names(n)
will return the names of the vertices.
network.vertex.names(n)
[1] "Abigail" "Francis" "Christy" "Bob" "Daniel" "Ethan"