Each row in object x is bound with its closest neighbour in object y. Uses the nabor package.
Usage
ps_nearest(x, y, by = c("X", "Y"), dist_col = NULL, keep_names = FALSE, ...)Arguments
- x
A data.frame, tibble or sf object.
- y
A data.frame, tibble or sf object.
- by
A possibly named character vector specifying the column(s) to calculate the distance over.
- dist_col
A string indicating the name of the column to save the distance in.
- keep_names
A flag specifying whether to keep the original sfc names instead of renaming them to geometry.
- ...
Not used