GraphSpace-attributes: Attribute utilities for GraphSpace objects

GraphSpace-attributesR Documentation

Attribute utilities for GraphSpace objects

Description

Access and modify individual components of a GraphSpace object. Selected igraph methods are applied to the internal graph representation and propagated to downstream components.

Usage

## S4 method for signature 'GraphSpace'
gs_vertex_attr(x, name, ..., value)

## S4 replacement method for signature 'GraphSpace'
gs_vertex_attr(x, name, ...) <- value

## S4 method for signature 'GraphSpace'
gs_edge_attr(x, name, ..., value)

## S4 replacement method for signature 'GraphSpace'
gs_edge_attr(x, name, ...) <- value

Arguments

x

A GraphSpace class object

name

Name of the attribute.

...

Additional arguments passed to extraction methods.

value

Replacement value for the selected slot or attribute.

Examples

library(RGraphSpace)
library(igraph)

# Load a demo igraph
data('gtoy1', package = 'RGraphSpace')

# Create a new GraphSpace object
gs <- GraphSpace(gtoy1)

#--- Usage of GraphSpace attribute accessors:

# Access all vertex attributes
gs_vertex_attr(gs)

# Access a specific vertex attribute
gs_vertex_attr(gs, "nodeLabel")

# Modify a single value within a vertex attribute
gs_vertex_attr(gs, "nodeSize")["n1"] <- 10

# Replace an entire vertex attribute
gs_vertex_attr(gs, "nodeSize") <- 10

# Add a new vertex attribute
gs_vertex_attr(gs, "node_var1") <- rnorm(gs_vcount(gs))

# Delete a vertex attribute
gs_vertex_attr(gs, "node_var1") <- NULL

# Access a specific edge attribute
gs_edge_attr(gs, "edgeColor")

# Replace an entire edge attribute
gs_edge_attr(gs, "edgeLineWidth") <- 1

# Add a new edge attribute
gs_edge_attr(gs, "edge_var1") <- rnorm(gs_ecount(gs))

# Delete an edge attribute
gs_edge_attr(gs, "edge_var1") <- NULL


RGraphSpace documentation built on Oct. 9, 2026, 9:07 a.m.