Skip to content

Commit

Permalink
Add documentation for edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Dec 12, 2016
1 parent 65af7d3 commit 8436fde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/quadrants.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#' (quads = quadrant(sp_obj))
#' plot(sp_obj, col = factor(quads))
#' points(rgeos::gCentroid(sp_obj), col = "white")
#' # edge cases (e.g. when using rasters) lead to NAs
#' sp_obj = raster::rasterToPolygons(raster::raster(ncol = 3, nrow = 3))
#' (quads = quadrant(sp_obj))
#' plot(sp_obj, col = factor(quads))
quadrant <- function(sp_obj, number_out = FALSE) {
cent = rgeos::gCentroid(sp_obj)
cents = rgeos::gCentroid(sp_obj, byid = TRUE)
Expand Down
4 changes: 4 additions & 0 deletions man/quadrant.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8436fde

Please # to comment.