File: igraph-minus.Rd

package info (click to toggle)
r-cran-igraph 1.0.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 18,232 kB
  • sloc: ansic: 173,538; cpp: 19,365; fortran: 4,550; yacc: 1,164; tcl: 931; lex: 484; makefile: 149; sh: 9
file content (69 lines) | stat: -rw-r--r-- 2,675 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/operators.R
\name{igraph-minus}
\alias{-.igraph}
\alias{igraph-minus}
\title{Delete vertices or edges from a graph}
\usage{
\method{-}{igraph}(e1, e2)
}
\arguments{
\item{e1}{Left argument, see details below.}

\item{e2}{Right argument, see details below.}
}
\value{
An igraph graph.
}
\description{
Delete vertices or edges from a graph
}
\details{
The minus operator (\sQuote{\code{-}}) can be used to remove vertices
or edges from the graph. The operation performed is selected based on
the type of the right hand side argument:
\itemize{
\item If it is an igraph graph object, then the difference of the
  two graphs is calculated, see \code{\link{difference}}.
\item If it is a numeric or character vector, then it is interpreted
  as a vector of vertex ids and the specified vertices will be
  deleted from the graph. Example: \preformatted{  g <- make_ring(10)
V(g)$name <- letters[1:10]
g <- g - c("a", "b")}
\item If \code{e2} is a vertex sequence (e.g. created by the
  \code{\link{V}} function), then these vertices will be deleted from
  the graph.
\item If it is an edge sequence (e.g. created by the \code{\link{E}}
  function), then these edges will be deleted from the graph.
\item If it is an object created with the \code{\link{vertex}} (or the
  \code{\link{vertices}}) function, then all arguments of \code{\link{vertices}} are
  concatenated and the result is interpreted as a vector of vertex
  ids. These vertices will be removed from the graph.
\item If it is an object created with the \code{\link{edge}} (or the
  \code{\link{edges}}) function, then all arguments of \code{\link{edges}} are
  concatenated and then interpreted as edges to be removed from the
  graph.
  Example: \preformatted{  g <- make_ring(10)
V(g)$name <- letters[1:10]
E(g)$name <- LETTERS[1:10]
g <- g - edge("e|f")
g <- g - edge("H")}
\item If it is an object created with the \code{\link{path}} function,
  then all \code{\link{path}} arguments are concatenated and then interpreted
  as a path along which edges will be removed from the graph.
  Example: \preformatted{  g <- make_ring(10)
V(g)$name <- letters[1:10]
g <- g - path("a", "b", "c", "d")}
}
}
\seealso{
Other functions for manipulating graph structure: \code{\link{+.igraph}};
  \code{\link{add.edges}}, \code{\link{add_edges}};
  \code{\link{add.vertices}}, \code{\link{add_vertices}};
  \code{\link{delete.edges}}, \code{\link{delete_edges}};
  \code{\link{delete.vertices}},
  \code{\link{delete_vertices}}; \code{\link{edge}},
  \code{\link{edges}}; \code{\link{path}};
  \code{\link{vertex}}, \code{\link{vertices}}
}