Skip to content

Commit

Permalink
refactor: Tidy 🚧
Browse files Browse the repository at this point in the history
  • Loading branch information
luukvdmeer committed Dec 30, 2024
1 parent 93c2cc0 commit 563651d
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions R/ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,36 +249,6 @@ node_incident_ids = function(x, nodes) {
ids
}

#' Extract for a node pair in a spatial network the indices of connecting edges
#'
#' @param x An object of class \code{\link{sfnetwork}}.
#'
#' @param nodes A vector of two integer indices specifying the node pair
#' between which edges should be found.
#'
#' @note If the network is directed, this function will only return the
#' edges that go from the first node of the given pair to the second node
#' of the given pair.
#'
#' @returns A vector of integer indices specifying the edges between the
#' given nodes.
#'
#' @importFrom igraph get_edge_ids igraph_opt igraph_options
#' @noRd
node_connector_ids = function(x, nodes) {
# Change default igraph options.
# This prevents igraph returns node or edge indices as formatted sequences.
# We only need the "raw" integer indices.
# Changing this option can lead to quite a performance improvement.
default_igraph_opt = igraph_opt("return.vs.es")
if (default_igraph_opt) {
igraph_options(return.vs.es = FALSE)
on.exit(igraph_options(return.vs.es = default_igraph_opt))
}
# Query edge indices.
get_edge_ids(x, nodes, error = TRUE)
}

#' Extract for each edge in a spatial network the indices of incident nodes
#'
#' @param x An object of class \code{\link{sfnetwork}}.
Expand Down

0 comments on commit 563651d

Please sign in to comment.