\HeaderA{igraph from/to graphNEL conversion}{Convert igraph graphs to graphNEL objects or back}{igraph from/to graphNEL conversion}
\aliasA{igraph.from.graphNEL}{igraph from/to graphNEL conversion}{igraph.from.graphNEL}
\aliasA{igraph.to.graphNEL}{igraph from/to graphNEL conversion}{igraph.to.graphNEL}
\keyword{graphs}{igraph from/to graphNEL conversion}
\begin{Description}\relax
The graphNEL class is defined in the \code{graph} package,
it is another way to represent graphs. These functions are provided to
convert between the igraph and the graphNEL objects.
\end{Description}
\begin{Usage}
\begin{verbatim}
igraph.from.graphNEL(graphNEL, name = TRUE, weight = TRUE,
              unlist.attrs = TRUE)
igraph.to.graphNEL(graph)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graphNEL}] The graphNEL graph.
\item[\code{name}] Logical scalar, whether to add graphNEL vertex names as an
igraph vertex attribute called \sQuote{\code{name}}.
\item[\code{weight}] Logical scalar, whether to add graphNEL edge weights as
an igraph edge attribute called \sQuote{\code{weight}}. (graphNEL
graphs are always weighted.)
\item[\code{unlist.attrs}] Logical scalar. graphNEL attribute query functions
return the values of the attributes in R lists, if this argument is
\code{TRUE} (the default) these will be converted to atomic vectors,
whenever possible, before adding them to the igraph graph.
\item[\code{graph}] An igraph graph object.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{igraph.from.graphNEL} takes a graphNEL graph and converts it to
an igraph graph. It handles all graph/vertex/edge attributes. If the
graphNEL graph has a vertex attribute called \sQuote{\code{name}} it
will be used as igraph vertex attribute \sQuote{\code{name}} and the
graphNEL vertex names will be ignored.

\code{igraph.to.graphNEL} converts and igraph graph to a graphNEL
graph. It converts all graph/vertex/edge attributes. If the igraph
graph has a vertex attribute \sQuote{\code{name}}, then it will be
used to assign vertex names in the graphNEL graph. Otherwise igraph
vertex ids will be used for this purpose.
\end{Details}
\begin{Value}
\code{igraph.from.graphNEL} returns an igraph graph object.

\code{igraph.to.graphNEL} returns a graphNEL graph object.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{get.adjacency}{get.adjacency}}, \code{\LinkA{graph.adjacency}{graph.adjacency}},
\code{\LinkA{get.adjlist}{get.adjlist}} and \code{\LinkA{graph.adjlist}{graph.adjlist}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- graph.ring(10)
V(g)$name <- letters[1:10]
GNEL <- igraph.to.graphNEL(g)
g2 <- igraph.from.graphNEL(GNEL)
g2
\end{ExampleCode}
\end{Examples}

