From ac328319f2c07c2c58efa47e35767498c129c44b Mon Sep 17 00:00:00 2001 From: olivroy Date: Mon, 2 Sep 2024 12:54:59 -0400 Subject: [PATCH] Move comment properly --- R/geom-predicates.R | 3 ++- man/st_equals.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/geom-predicates.R b/R/geom-predicates.R index 56467c30c..c44b7ce87 100644 --- a/R/geom-predicates.R +++ b/R/geom-predicates.R @@ -230,7 +230,7 @@ st_overlaps = function(x, y, sparse = TRUE, prepared = TRUE, ...) #' see also \link{distinct.sf} to find records where geometries AND attributes are distinct. #' @param remove_self logical; if `TRUE` (and `y` is missing) return only indexes of geometries different from the current index; this can be used to omit self-intersections; see examples. #' This argument can be used for all geometry predicates -#' @param ... passed on to [s2::s2_equals()] +#' @param ... passed on to [s2::s2_options()] #' @export #' @family geometric binary predicates for two spatial objects #' @examples @@ -241,6 +241,7 @@ st_overlaps = function(x, y, sparse = TRUE, prepared = TRUE, ...) #' st_equals(p) #' st_equals(p, remove_self = TRUE) #' (u = st_equals(p, retain_unique = TRUE)) +#' # retain the records with unique geometries: #' p[-unlist(u),] st_equals = function(x, y, sparse = TRUE, prepared = FALSE, ..., retain_unique = FALSE, remove_self = FALSE) { diff --git a/man/st_equals.Rd b/man/st_equals.Rd index c2273dc08..e802f0e62 100644 --- a/man/st_equals.Rd +++ b/man/st_equals.Rd @@ -26,7 +26,7 @@ st_equals_exact(x, y, par, sparse = TRUE, prepared = FALSE, ...) \item{prepared}{logical; prepare geometry for \code{x}, before looping over \code{y}? See Details.} -\item{...}{passed on to \code{\link[s2:s2_contains]{s2::s2_equals()}}} +\item{...}{passed on to \code{\link[s2:s2_options]{s2::s2_options()}}} \item{retain_unique}{logical; if \code{TRUE} (and \code{y} is missing) return only indexes of points larger than the current index; this can be used to select @@ -52,6 +52,7 @@ p = st_sf(a = letters[1:8], geom = st_sfc(p1, p1, p2, p1, p1, p2, p2, p1)) st_equals(p) st_equals(p, remove_self = TRUE) (u = st_equals(p, retain_unique = TRUE)) +# retain the records with unique geometries: p[-unlist(u),] } \seealso{