# \donttest{
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
# }
Run the code above in your browser using DataLab