R/clip.R

Defines functions clip_raster

Documented in clip_raster

#' Crop and mask a raster by polygon
#'
#' @export
#'
clip_raster <- function(r, s) {
  a <- raster::crop(r, s, snap="in")
  z <- raster::mask(a, s)

  return(z)
}
italocegatta/rapidr documentation built on May 18, 2019, 5:52 a.m.