Each row in object x is bound with its closest neighbour in object y. Uses the nabor package.
ps_nearest(x, y, by = c("X", "Y"), dist_col = NULL, ...)
The column(s) to use when calculating the distances are converted to numeric values. Missing values are currently not permitted.
sf objects have their sf (active geometry) column renamed to geometry. The nearest calculation for non-point sf objects is based on feature vertices.