saveShapefile <- function(shape, directory, layerName) {
rgdal::writeOGR(shape, directory, layerName, driver="ESRI Shapefile")
}
saveGeojson <- function(shape, filepath) {
rgdal::writeOGR(shape, filepath, "OGRGeoJSON", driver="GeoJSON")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.