File: edge_types.Rd

package info (click to toggle)
r-cran-tidygraph 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 736 kB
  • sloc: cpp: 35; sh: 13; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/edge.R
\name{edge_types}
\alias{edge_types}
\alias{edge_is_multiple}
\alias{edge_is_loop}
\alias{edge_is_mutual}
\alias{edge_is_from}
\alias{edge_is_to}
\alias{edge_is_between}
\alias{edge_is_incident}
\title{Querying edge types}
\usage{
edge_is_multiple()

edge_is_loop()

edge_is_mutual()

edge_is_from(from)

edge_is_to(to)

edge_is_between(from, to, ignore_dir = !graph_is_directed())

edge_is_incident(i)
}
\arguments{
\item{from, to, i}{A vector giving node indices}

\item{ignore_dir}{Is both directions of the edge allowed}
}
\value{
A logical vector of the same length as the number of edges in the
graph
}
\description{
These functions lets the user query whether the edges in a graph is of a
specific type. All functions return a logical vector giving whether each edge
in the graph corresponds to the specific type.
}
\section{Functions}{
\itemize{
\item \code{edge_is_multiple}: Query whether each edge has any parallel siblings

\item \code{edge_is_loop}: Query whether each edge is a loop

\item \code{edge_is_mutual}: Query whether each edge has a sibling going in the reverse direction

\item \code{edge_is_from}: Query whether an edge goes from a set of nodes

\item \code{edge_is_to}: Query whether an edge goes to a set of nodes

\item \code{edge_is_between}: Query whether an edge goes between two sets of nodes

\item \code{edge_is_incident}: Query whether an edge goes from or to a set of nodes
}}

\examples{
create_star(10, directed = TRUE, mutual = TRUE) \%>\%
  activate(edges) \%>\%
  sample_frac(0.7) \%>\%
  mutate(single_edge = !edge_is_mutual())
}