diff --git a/DESCRIPTION b/DESCRIPTION index 4667b08..8148373 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,8 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 Suggests: - testthat (>= 3.0.0) + testthat (>= 3.0.0), + sfnetworks Config/testthat/edition: 3 Imports: dplyr, diff --git a/R/stroke.R b/R/stroke.R index 696eace..311b207 100644 --- a/R/stroke.R +++ b/R/stroke.R @@ -3,7 +3,7 @@ #' Apply the Continuity in Street Network (COINS) method to identify #' sequences of edges that form naturally continuous strokes in a network. #' -#' @param edges An object of class \code{\link[sfc]{sfc}} (or compatible), +#' @param edges An object of class \code{\link[sf]{sfc}} (or compatible), #' including the edge geometries (should be of type LineString or #' MultiLineString). #' @@ -22,7 +22,7 @@ #' @param from_edge Only look for the continuous strokes that include the #' provided edges or line segments. #' -#' @return An object of class \code{\link[sfc]{sfc}} (if +#' @return An object of class \code{\link[sf]{sfc}} (if #' \code{attributes = FALSE}), a vector with the same length as \code{edges} #' otherwise. #' @@ -97,11 +97,11 @@ to_line_segments <- function(points, nodes) { #' @noRd get_links <- function(segments) { nsegments <- nrow(segments) - connections <- data.frame(node_id = as.vector(segments)) |> + links <- data.frame(node_id = as.vector(segments)) |> dplyr::group_by(node_id) |> dplyr::group_rows() |> lapply(function(x) (x - 1) %% nsegments + 1) - return(connections) + return(links) } #' @noRd