There was an error while loading. Please reload this page.
1 parent 47cbfbd commit db9f8b4Copy full SHA for db9f8b4
1 file changed
R/getDistFromSource.R
@@ -63,9 +63,9 @@
63
#' library(terra)
64
#'
65
#' #make example roads from scratch
66
-#' rds <- data.frame(x = 1:1000/100, y = cos(1:1000/100)) %>%
67
-#' st_as_sf(coords = c("x", "y")) %>%
68
-#' st_union() %>%
+#' rds <- data.frame(x = 1:1000/100, y = cos(1:1000/100)) |>
+#' st_as_sf(coords = c("x", "y")) |>
+#' st_union() |>
69
#' st_cast("LINESTRING")
70
71
#' rds_rast <- rasterize(vect(rds),
@@ -77,7 +77,7 @@
77
#' terra::distance(rds_rast)
78
79
#' # or straight from the line
80
-#' terra::distance(rds_rast, terra::vect(rds %>% st_set_crs(st_crs(rds_rast))))
+#' terra::distance(rds_rast, terra::vect(rds |> st_set_crs(st_crs(rds_rast))))
81
#'}
82
#'@keywords internal
83
0 commit comments