utils_shapefile | R Documentation |
shapefile_input()
creates or importes a shapefile and optionally convert
it to an sf
object.
shapefile_export()
exports an object (sf
or SpatVector
) to a file
shapefile_view()
is a simple wrapper around mapview() to plot a shapefile.
shapefile_input(shapefile, info = TRUE, as_sf = TRUE, ...)
shapefile_export(shapefile, filename, ...)
shapefile_view(
shapefile,
attribute = NULL,
color_regions = custom_palette(c("red", "yellow", "forestgreen")),
...
)
shapefile |
For For |
info |
Logical value indicating whether to print information about the
imported shapefile (default is |
as_sf |
Logical value indicating whether to convert the imported
shapefile to an |
... |
Additional arguments to be passed to |
filename |
The path to the output shapefile. |
attribute |
The attribute to be shown in the color key. It must be a
variable present in |
color_regions |
The color palette to represent |
shapefile_input()
returns an object of class sf
(default) representing
the imported shapefile.
shapefile_export()
returns a NULL
object.
shapefile_view()
returns an object of class mapview
.
library(pliman)
shp <- system.file("ex/lux.shp", package="terra")
shp_file <- shapefile_input(shp, as_sf = FALSE)
shapefile_view(shp_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.