Description Usage Arguments Details Author(s) See Also Examples
This is a wrapper for the shapefile function (from the raster package). It performs additonal checks on data covariates (converting all logical and character variables to factors) and prepares a 'fortified' version of SpatialPolygons objects data to allow ggplot-style plotting.
1 | import_shp(x, fortify = TRUE, ...)
|
x |
file path of the shapefile including the file name (the file
extension is not required since it is assumed to be |
fortify |
if |
... |
additional arguments to pass to shapefile |
A list with two elements:
sp | an object of class SpatialPolygons or SpatialPoints |
fortified | for polygon shapefiles, this will be the result of
applying the fortify function to the sp element |
Darren Kidney darrenkidney@googlemail.com
plot.gshp, import_data
1 2 3 4 5 6 7 | ## Not run:
folder = system.file("extdata/N.annamensis", package = "gibbonsecr")
region = import_shp(file.path(folder, "region.shp"))
habitat = import_shp(file.path(folder, "habitat.shp"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.