#' Extract a zonal statistics by polygon
#'
#' @export
#'
extract2df <- function(raster, extent, fun = mean) {
e <- raster::extract(raster, extent, fun = fun, na.rm = TRUE, sp = TRUE)
z <- as.data.frame(e)
return(z)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.