| hull | R Documentation |
Add a convex hull to a map
hull(x, ...)
x |
input |
... |
ignored |
Can be used with map_leaflet(), map_plot(),
and map_ggplot(). Other methods in this package may be supported
in the future.
Adds a convex hull to the plot. See grDevices::chull()
for info.
# map spocc output, here using a built in object
data(occdat_eg1)
map_plot(occdat_eg1, hull = TRUE)
# map rgbif output, here using a built in object
hull(map_ggplot(occdat_eg1))
## Not run:
# leaflet
library("spocc")
spp <- c('Danaus plexippus', 'Accipiter striatus', 'Pinus contorta')
dat <- occ(spp, from = 'gbif', limit = 30, has_coords = TRUE)
hull(map_leaflet(dat))
# ggplot
if (requireNamespace("rgbif")) {
library("rgbif")
res <- occ_search(scientificName = "Puma concolor", limit = 100)
hull(map_ggplot(res))
}
# base plots
library("spocc")
out <- occ(query='Accipiter striatus', from='gbif', limit=25,
has_coords=TRUE)
map_plot(out, hull = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.