Skip to content

Commit db9f8b4

Browse files
author
Sarah Endicott
committed
change pipe
1 parent 47cbfbd commit db9f8b4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

R/getDistFromSource.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
#' library(terra)
6464
#'
6565
#' #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() %>%
66+
#' rds <- data.frame(x = 1:1000/100, y = cos(1:1000/100)) |>
67+
#' st_as_sf(coords = c("x", "y")) |>
68+
#' st_union() |>
6969
#' st_cast("LINESTRING")
7070
#'
7171
#' rds_rast <- rasterize(vect(rds),
@@ -77,7 +77,7 @@
7777
#' terra::distance(rds_rast)
7878
#'
7979
#' # or straight from the line
80-
#' terra::distance(rds_rast, terra::vect(rds %>% st_set_crs(st_crs(rds_rast))))
80+
#' terra::distance(rds_rast, terra::vect(rds |> st_set_crs(st_crs(rds_rast))))
8181
#'}
8282
#'@keywords internal
8383

0 commit comments

Comments
 (0)