Skip to content

Commit 04c8c31

Browse files
author
Andrea Gilardi
committed
document [.sfc
1 parent b56266f commit 04c8c31

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

R/sfc.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ format.sfc = function(x, ..., width = 30) {
3636
#' pt1 = st_point(c(0,1))
3737
#' pt2 = st_point(c(1,1))
3838
#' (sfc = st_sfc(pt1, pt2))
39+
#' sfc[sfc[1], op = st_is_within_distance, dist = 0.5]
3940
#' d = st_sf(data.frame(a=1:2, geom=sfc))
4041
#' @export
4142
st_sfc = function(..., crs = NA_crs_, precision = 0.0, check_ring_dir = FALSE, dim,
@@ -139,6 +140,13 @@ st_sfc = function(..., crs = NA_crs_, precision = 0.0, check_ring_dir = FALSE, d
139140
lst
140141
}
141142

143+
#' @name sfc
144+
#' @param x object of class \code{sfc}
145+
#' @param i record selection. Might also be an \code{sfc}/\code{sf} object to work with the \code{op} argument
146+
#' @param j ignored
147+
#' @param op function, geometrical binary predicate function to apply when
148+
#' \code{i} is a \code{sf}/\code{sfc} object. Additional arguments can be
149+
#' specified using \code{...}, see examples.
142150
#' @export
143151
"[.sfc" = function(x, i, j, ..., op = st_intersects) {
144152
if (!missing(i) && (inherits(i, "sf") || inherits(i, "sfc") || inherits(i, "sfg")))

man/sfc.Rd

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)