File: node_types.Rd

package info (click to toggle)
r-cran-tidygraph 1.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 880 kB
  • sloc: cpp: 41; sh: 13; makefile: 2
file content (108 lines) | stat: -rw-r--r-- 3,121 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/node.R
\name{node_types}
\alias{node_types}
\alias{node_is_cut}
\alias{node_is_root}
\alias{node_is_leaf}
\alias{node_is_sink}
\alias{node_is_source}
\alias{node_is_isolated}
\alias{node_is_universal}
\alias{node_is_simplical}
\alias{node_is_center}
\alias{node_is_adjacent}
\alias{node_is_keyplayer}
\alias{node_is_connected}
\title{Querying node types}
\usage{
node_is_cut()

node_is_root()

node_is_leaf()

node_is_sink()

node_is_source()

node_is_isolated()

node_is_universal(mode = "out")

node_is_simplical(mode = "out")

node_is_center(mode = "out")

node_is_adjacent(to, mode = "all", include_to = TRUE)

node_is_keyplayer(k, p = 0, tol = 1e-04, maxsec = 120, roundsec = 30)

node_is_connected(nodes, mode = "all", any = FALSE)
}
\arguments{
\item{mode}{The way edges should be followed in the case of directed graphs.}

\item{to}{The nodes to test for adjacency to}

\item{include_to}{Should the nodes in \code{to} be marked as adjacent as well}

\item{k}{The number of keyplayers to identify}

\item{p}{The probability to accept a lesser state}

\item{tol}{Optimisation tolerance, below which the optimisation will stop}

\item{maxsec}{The total computation budget for the optimization, in seconds}

\item{roundsec}{Number of seconds in between synchronizing workers' answer}

\item{nodes}{The set of nodes to test connectivity to. Can be a list to use
different sets for different nodes. If a list it will be recycled as
necessary.}

\item{any}{Logical. If \code{TRUE} the node only needs to be connected to a single
node in the set for it to return \code{TRUE}}
}
\value{
A logical vector of the same length as the number of nodes in the
graph.
}
\description{
These functions all lets the user query whether each node is of a certain
type. All of the functions returns a logical vector indicating whether the
node is of the type in question. Do note that the types are not mutually
exclusive and that nodes can thus be of multiple types.
}
\section{Functions}{
\itemize{
\item \code{node_is_cut()}: is the node a cut node (articaultion node)

\item \code{node_is_root()}: is the node a root in a tree

\item \code{node_is_leaf()}: is the node a leaf in a tree

\item \code{node_is_sink()}: does the node only have incomming edges

\item \code{node_is_source()}: does the node only have outgoing edges

\item \code{node_is_isolated()}: is the node unconnected

\item \code{node_is_universal()}: is the node connected to all other nodes in the graph

\item \code{node_is_simplical()}: are all the neighbors of the node connected

\item \code{node_is_center()}: does the node have the minimal eccentricity in the graph

\item \code{node_is_adjacent()}: is a node adjacent to any of the nodes given in \code{to}

\item \code{node_is_keyplayer()}: Is a node part of the keyplayers in the graph (\code{influenceR})

\item \code{node_is_connected()}: Is a node connected to all (or any) nodes in a set

}}
\examples{
# Find the root and leafs in a tree
create_tree(40, 2) \%>\%
  mutate(root = node_is_root(), leaf = node_is_leaf())
}