\dontrun{
library(raster)
st <- sf::read_sf("data-raw/shp/Continents.shp")
shp <- rgdal::readOGR("data-raw/shp/Continents.shp")
files <- "data-raw/PML2_yearly_static2017-01-01.tif"
b <- raster::brick(files[1])
geoms = sf::st_as_binary(sf::st_geometry(st), EWKB = TRUE)
r1 = extract2(files, st)
geoms <- overlap(b, st)
r1 = extract2(files, geoms)
r2 = extract2(files, geoms, weight = TRUE)
r3 = extract2(files, geoms)
r4 = extract2(files, shp)
r = brick(files[1]) %>% readAll()
extract2(r, geoms, fun = sf_median)
# extract2(r, geoms, fun = sf_max)
# extract2(r, geoms, fun = sf_min)
extract2(r, geoms, fun = sf_sd)
extract2(r, geoms, fun = sf_sum)
extract2(r, geoms, fun = sf_sum, weight = TRUE)
extract2(r, geoms, fun = sf_var, weight = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.