## File: reroute.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 (39 lines) | stat: -rw-r--r-- 1,215 bytes parent folder | download
 123456789101112131415161718192021222324252627282930313233343536373839 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/reroute.R \name{reroute} \alias{reroute} \title{Change terminal nodes of edges} \usage{ reroute(.data, from = NULL, to = NULL, subset = NULL) } \arguments{ \item{.data}{A tbl_graph or morphed_tbl_graph object. grouped_tbl_graph will be ungrouped prior to rerouting} \item{from, to}{The new indexes of the terminal nodes. If \code{NULL} nothing will be changed} \item{subset}{An expression evaluating to an indexing vector in the context of the edge data.} } \value{ An object of the same class as .data } \description{ The reroute verb lets you change the beginning and end node of edges by specifying the new indexes of the start and/or end node(s). Optionally only a subset of the edges can be rerouted using the subset argument, which should be an expression that are to be evaluated in the context of the edge data and should return an index compliant vector (either logical or integer). } \examples{ # Switch direction of edges create_notable('meredith') \%>\% activate(edges) \%>\% reroute(from = to, to = from) # Using subset create_notable('meredith') \%>\% activate(edges) \%>\% reroute(from = 1, subset = to > 10) }