getNodesAttr: Get nodes attributes from gGraph/gData object

getNodesAttrR Documentation

Get nodes attributes from gGraph/gData object

Description

The function getNodesAttr returns the values of a set of variables associated to the nodes (i.e. node attributes) of a gGraph or gData object.

Usage

getNodesAttr(x, ...)

## S4 method for signature 'gGraph'
getNodesAttr(x, nodes = NULL, attr.name = NULL, ...)

## S4 method for signature 'gData'
getNodesAttr(x, attr.name = NULL, ...)

Arguments

x

a valid gGraph or gData object.

...

other arguments passed to other methods (currently unused).

nodes

an optional integer, logical, or character string indicating the subset of nodes to be used. If NULL, all nodes are used.

attr.name

an optional character string indicating which node attributes should be returned. If provided, it must match at least one of the columns of x@nodes.attr.

Value

A data.frame with the requested nodes attributes. Nodes are displayed in rows, variables in columns.

Functions

  • getNodesAttr(gGraph): Method for gGraph objects

  • getNodesAttr(gData): Method for gData objects

See Also

Most other accessors are documented in gGraph and gData manpages.

Examples


## gGraph method
head(getNodesAttr(worldgraph.40k))


## gData method
getNodesAttr(hgdp)


thibautjombart/geograph documentation built on Jan. 27, 2024, 10 p.m.