% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gspace-methods.R
\name{names,GraphSpace-method}
\alias{names,GraphSpace-method}
\alias{names}
\alias{gs_names}
\alias{gs_nodes}
\alias{gs_edges}
\alias{gs_graph}
\alias{gs_image}
\alias{gs_image<-}
\alias{gs_fdata}
\alias{gs_fdata<-}
\alias{gs_features}
\alias{gs_nfeatures}
\alias{gs_vcount}
\alias{gs_ecount}
\alias{gs_vertex_attr}
\alias{gs_vertex_attr<-}
\alias{gs_edge_attr}
\alias{gs_edge_attr<-}
\alias{gs_names,GraphSpace-method}
\alias{gs_nodes,GraphSpace-method}
\alias{gs_edges,GraphSpace-method}
\alias{gs_image,GraphSpace-method}
\alias{gs_image<-,GraphSpace-method}
\alias{gs_graph,GraphSpace-method}
\alias{gs_fdata,GraphSpace-method}
\alias{gs_fdata<-,GraphSpace-method}
\alias{gs_nfeatures,GraphSpace-method}
\alias{gs_features,GraphSpace-method}
\alias{gs_vcount,GraphSpace-method}
\alias{gs_ecount,GraphSpace-method}
\alias{gs_vertex_attr,GraphSpace-method}
\alias{gs_vertex_attr<-,GraphSpace-method}
\alias{gs_edge_attr,GraphSpace-method}
\alias{gs_edge_attr<-,GraphSpace-method}
\alias{$,GraphSpace-method}
\alias{$<-,GraphSpace-method}
\alias{[[<-,GraphSpace-method}
\alias{as.igraph.GraphSpace}
\title{Accessors and attribute utilities for GraphSpace objects}
\usage{
\S4method{names}{GraphSpace}(x)

\S4method{gs_names}{GraphSpace}(x)

\S4method{gs_nodes}{GraphSpace}(x, ...)

\S4method{gs_edges}{GraphSpace}(x)

\S4method{gs_image}{GraphSpace}(x)

\S4method{gs_image}{GraphSpace}(x) <- value

\S4method{gs_graph}{GraphSpace}(x)

\S4method{gs_fdata}{GraphSpace}(x)

\S4method{gs_fdata}{GraphSpace}(x) <- value

\S4method{gs_nfeatures}{GraphSpace}(x)

\S4method{gs_features}{GraphSpace}(x)

\S4method{gs_vcount}{GraphSpace}(x)

\S4method{gs_ecount}{GraphSpace}(x)

\S4method{gs_vertex_attr}{GraphSpace}(x, name, ...)

\S4method{gs_vertex_attr}{GraphSpace}(x, name, ...) <- value

\S4method{gs_edge_attr}{GraphSpace}(x, name, ...)

\S4method{gs_edge_attr}{GraphSpace}(x, name, ...) <- value

\S4method{$}{GraphSpace}(x, name)

\S4method{$}{GraphSpace}(x, name) <- value

\method{as.igraph}{GraphSpace}(x, ...)
}
\arguments{
\item{x}{A \linkS4class{GraphSpace} class object}

\item{...}{Additional arguments passed to extraction methods.}

\item{value}{Replacement value for the selected slot or attribute.}

\item{name}{Name of the attribute.}
}
\value{
Updated \linkS4class{GraphSpace} object.
}
\description{
Access and modify individual components of a
\linkS4class{GraphSpace} object. Selected \pkg{igraph} methods are
applied to the internal graph representation and propagated to
downstream node and edge components.
}
\details{
For \code{gs_nodes()}, the optional \code{vars} argument specifies
node-associated features retrieved from the \code{fdata}
container. See also \code{\link{gs_fetch_features}}.
}
\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:

# Vertex names
names(gs)

# Vertex attribute names
gs_names(gs)

# Get a data frame with nodes
gs_nodes(gs)

# Get a data frame with edges
gs_edges(gs)

# Get vertex count
gs_vcount(gs)

# Get edge count
gs_ecount(gs)

# 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

# Alternative syntax using `$` accessor
gs_vertex_attr(gs)$nodeSize <- 10

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

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

# Alternative syntax using `$` for edge attributes
gs_edge_attr(gs)$edgeLineWidth <- 3

# Add an image and rescale graph coordinates to image space
# Images may be provided as a raster or numeric matrix
gs_image(gs) <- as_colorraster(volcano)
gs <- normalizeGraphSpace(gs)

}
\seealso{
\code{\link[igraph]{vertex_attr}}, \code{\link[igraph]{edge_attr}},
\code{\link{gs_fetch_features}}
}
