1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/operators.R
\name{edge}
\alias{edge}
\alias{edges}
\title{Helper function for adding and deleting edges}
\usage{
edge(...)
edges(...)
}
\arguments{
\item{...}{See details below.}
}
\value{
A special object that can be used with together with
igraph graphs and the plus and minus operators.
}
\description{
This is a helper function that simplifies adding and deleting
edges to/from graphs.
}
\details{
\code{edges()} is an alias for \code{edge()}.
When adding edges via \code{+}, all unnamed arguments of
\code{edge()} (or \code{edges()}) are concatenated, and then passed to
\code{\link[=add_edges]{add_edges()}}. They are interpreted as pairs of vertex ids,
and an edge will added between each pair. Named arguments will be
used as edge attributes for the new edges.
When deleting edges via \code{-}, all arguments of \code{edge()} (or
\code{edges()}) are concatenated via \code{c()} and passed to
\code{\link[=delete_edges]{delete_edges()}}.
}
\examples{
g <- make_ring(10) \%>\%
set_edge_attr("color", value = "red")
g <- g + edge(1, 5, color = "green") +
edge(2, 6, color = "blue") -
edge("8|9")
E(g)[[]]
g \%>\%
add_layout_(in_circle()) \%>\%
plot()
g <- make_ring(10) + edges(1:10)
plot(g)
}
\seealso{
Other functions for manipulating graph structure:
\code{\link{+.igraph}()},
\code{\link{add_edges}()},
\code{\link{add_vertices}()},
\code{\link{complementer}()},
\code{\link{compose}()},
\code{\link{connect}()},
\code{\link{contract}()},
\code{\link{delete_edges}()},
\code{\link{delete_vertices}()},
\code{\link{difference}()},
\code{\link{difference.igraph}()},
\code{\link{disjoint_union}()},
\code{\link{igraph-minus}},
\code{\link{intersection}()},
\code{\link{intersection.igraph}()},
\code{\link{path}()},
\code{\link{permute}()},
\code{\link{rep.igraph}()},
\code{\link{reverse_edges}()},
\code{\link{simplify}()},
\code{\link{union}()},
\code{\link{union.igraph}()},
\code{\link{vertex}()}
}
\concept{functions for manipulating graph structure}
|