Description Usage Arguments Examples
Wrapper on  sf::st_write for writing an sf or sp object to disk as
an ESRI shapefile
| 1 2 | write_shape(out_obj, out_file, overwrite = FALSE, verbose = FALSE,
  encoding = "UTF-8", create_dir = FALSE, ...)
 | 
| out_obj | 
 | 
| out_file | 
 | 
| overwrite | 
 | 
| verbose | 
 | 
| encoding | 
 | 
| create_dir | 
 | 
| ... | any other arguments to be passed to  | 
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run: 
# build a spatialpoints data frame
pts                <- cbind(1:5, 1:5)
dimnames(pts)[[1]] <- letters[1:5]
df                 <-  data.frame(a = 1:5)
row.names(df)      <- letters[5:1]
points             <- sp::SpatialPointsDataFrame(pts, df, match.ID = TRUE)
# Save it to a shape file
out_file  = tempfile(pattern = "test", tmpdir = tempdir(), fileext = ".shp")
mysp_object = points
write_shape(mysp_object, out_file, overwrite = TRUE)
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.