Skip to content

Commit

Permalink
Add aggregate.sf example
Browse files Browse the repository at this point in the history
Demonstrates what happens when features in y do not intersect with x
  • Loading branch information
Robinlovelace committed Aug 3, 2017
1 parent 7734517 commit ad52a39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/aggregate.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#' p_buff = st_buffer(p, 0.2)
#' plot(p_buff, add = TRUE)
#' aggregate(p_buff, pol, mean) # increased mean of second
#' # with non-matching features
#' m3 = cbind(c(0, 0, 0.1, 0), c(0, 0.1, 0.1, 0))
#' pol = st_sfc(st_polygon(list(m1)), st_polygon(list(m2)), st_polygon(list(m3)))
#' aggregate(p, pol, mean)
#' @export
aggregate.sf = function(x, by, FUN, ..., do_union = TRUE, simplify = TRUE,
join = st_intersects) {
Expand Down

0 comments on commit ad52a39

Please sign in to comment.