| dgearthgrid | R Documentation | 
Note: If you have a high-resolution grid this may take a very long time to execute.
dgearthgrid(dggs, savegrid = NA, return_sf = TRUE)
dggs | 
 A dggs object from dgconstruct().  | 
savegrid | 
 If savegrid is set to a file path, then a shapefile containing the grid is written to that path and the filename is returned. No other manipulations are done. Default: NA (do not save grid, return it)  | 
return_sf | 
 logical. If   | 
Returns an sf object.
If !is.na(savegrid), returns a filename.
library(dggridR)
dggs         <- dgconstruct(res=20)
res          <- dg_closest_res_to_spacing(dggs,spacing=1000,round='down',metric=FALSE)
dggs         <- dgsetres(dggs,res)
gridfilename <- dgearthgrid(dggs,savegrid=tempfile(fileext=".shp")) #Save directly to a file
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.