% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/attributes.R
\name{edge_attr}
\alias{edge_attr}
\alias{edge.attributes}
\title{Query edge attributes of a graph}
\usage{
edge_attr(graph, name, index = E(graph))
}
\arguments{
\item{graph}{The graph}

\item{name}{The name of the attribute to query. If missing, then
all edge attributes are returned in a list.}

\item{index}{An optional edge sequence to query edge attributes
for a subset of edges.}
}
\value{
The value of the edge attribute, or the list of all
edge attributes if \code{name} is missing.
}
\description{
Query edge attributes of a graph
}
\section{Related documentation in the C library}{
\href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_edges}{\code{edges()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_get_eids}{\code{get_eids()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_ecount}{\code{ecount()}}
}

\examples{
g <- make_ring(10) \%>\%
  set_edge_attr("weight", value = 1:10) \%>\%
  set_edge_attr("color", value = "red")
g
plot(g, edge.width = E(g)$weight)
}
\seealso{
Vertex, edge and graph attributes
\code{\link{delete_edge_attr}()},
\code{\link{delete_graph_attr}()},
\code{\link{delete_vertex_attr}()},
\code{\link{edge_attr<-}()},
\code{\link{edge_attr_names}()},
\code{\link{graph_attr}()},
\code{\link{graph_attr<-}()},
\code{\link{graph_attr_names}()},
\code{\link{igraph-attribute-combination}},
\code{\link{igraph-dollar}},
\code{\link{igraph-vs-attributes}},
\code{\link{set_edge_attr}()},
\code{\link{set_graph_attr}()},
\code{\link{set_vertex_attr}()},
\code{\link{set_vertex_attrs}()},
\code{\link{vertex_attr}()},
\code{\link{vertex_attr<-}()},
\code{\link{vertex_attr_names}()}
}
\concept{attributes}
