Learn R Programming

migraph (version 0.9.3)

grab: Helpers to grab various attributes from nodes or edges in a graph

Description

Helpers to grab various attributes from nodes or edges in a graph

Usage

node_names(object)

node_mode(object)

node_attribute(object, attribute)

edge_attribute(object, attribute)

edge_weights(object)

edge_signs(object)

graph_nodes(object)

graph_edges(object)

graph_dims(object)

graph_node_attributes(object)

graph_edge_attributes(object)

Arguments

object

An object of a migraph-consistent class:

  • matrix, from base R

  • edgelist, a data frame from base R or tibble from tibble

  • igraph, from the igraph package

  • network, from the network package

  • tbl_graph, from the tidygraph package

attribute

Character string naming an attribute in the object.

Functions

  • node_names: Extracts the names of the nodes in a network.

  • node_mode: Extracts the mode of the nodes in a network.

  • node_attribute: Extracts an attribute's values for the nodes in a network.

  • edge_attribute: Extracts an attribute's values for the edges in a network.

  • edge_weights: Extracts the weights of the edges in a network.

  • edge_signs: Extracts the signs of the edges in a network.

  • graph_nodes: Returns the number of nodes (of any mode) in a network.

  • graph_edges: Returns the number of edges in a network.

  • graph_dims: Returns the dimensions of a network in a vector as long as the number of modes in the network.

  • graph_node_attributes: Returns a vector of nodal attributes in a network

  • graph_edge_attributes: Returns a vector of edge attributes in a network

Examples

Run this code
# NOT RUN {
node_names(mpn_elite_usa_advice)
node_mode(mpn_elite_usa_advice)
node_attribute(mpn_elite_mex, "full_name")
edge_attribute(ison_algebra, "task_tie")
edge_weights(to_mode1(ison_southern_women))
edge_signs(ison_marvel_relationships)
graph_nodes(ison_southern_women)
graph_edges(ison_southern_women)
graph_dims(ison_southern_women)
graph_dims(to_mode1(ison_southern_women))
graph_node_attributes(mpn_elite_mex)
graph_edge_attributes(mpn_elite_mex)
# }

Run the code above in your browser using DataLab