graph: Extract graph attributes

nodesR Documentation

Extract graph attributes

Description

Extract node or edge attributes from a tidygraph tbl_graph object.

Usage

nodes(graph)

edges(graph)

Arguments

graph

object of class tbl_graph

Examples

a_graph <- tidygraph::tbl_graph(
  nodes = data.frame(
    name = c('a','b','c')
  ), 
  edges = data.frame(
    from = c(1,2),
    to = c(2,3),
    type = c(1,2)
  ))

## Extract graph nodes
nodes(a_graph)

## Extract graph edges
edges(a_graph)

jasenfinch/MFassign documentation built on Feb. 2, 2024, 11:21 a.m.