\donttest{
library(raster)
prod <- sdc_raster(enterprises, field = "production", r = 500)
print(prod)
prod <- sdc_raster(enterprises, field = "production", r = 1e3)
print(prod)
# get raster with the average production per cell averaged over the enterprises
prod_mean <- mean(prod)
summary(prod_mean)
# get raster with the total production per cell
prod_total <- sum(prod)
summary(prod_total)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.