| AbstractGraph {pkgnet} | R Documentation |
Base class for Graphs
Description
pkgnet uses R6 classes to define and encapsulate the graph
models for representing package networks. These classes implement
different types of graphs and functionality to calculate their respective
graph theory measures. The base class AbstractGraph defines the
standard interfaces and functionality.
Currently the only implemented type of graph is DirectedGraph.
Active bindings
nodesnode data.table, read-only.
edgesedge data.table, read-only.
igraphigraph object, read-only.
available_node_measurescharacter vector of all supported node measures. See Node Measures section in DirectedGraphMeasures for details about each measure.
available_graph_measurescharacter vector of all supported graph measures. See Graph Measures section in DirectedGraphMeasures for details about each measure. Read-only.
default_node_measurescharacter vector of default node measures. See Node Measures section in DirectedGraphMeasures for details about each measure.
default_graph_measurescharacter vector of default graph measures. See Graph Measures section in DirectedGraphMeasures for details about each measure. Read-only.
Methods
Public methods
Method new()
Instantiate new object of the class.
Usage
AbstractGraph$new(nodes, edges)
Arguments
nodesa data.table containing nodes
edgesa data.table containing edges
Returns
Self, invisibly.
Method node_measures()
Return specified node-level measures, calculating if necessary. See Node Measures section in DirectedGraphMeasures for details about each measure.
Usage
AbstractGraph$node_measures(measures = NULL)
Arguments
measurescharacter vector of measure names. Default NULL will return those that are already calculated.
Returns
a data.table with specified node meaures as columns
Method graph_measures()
Return specified graph-level measures, calculating if necessary. See Graph Measures section in DirectedGraphMeasures for details about each measure.
Usage
AbstractGraph$graph_measures(measures = NULL)
Arguments
measurescharacter vector of measure names. Default NULL will return those that are already calculated.
Returns
list with specified graph measures.
Method print()
print igraph object
Usage
AbstractGraph$print()
Returns
Self, invisibly.
Method clone()
The objects of this class are cloneable with this method.
Usage
AbstractGraph$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.