Description Usage Arguments Details Examples
Make an interactive map to view in the browser as a GitHub gist
1 2 3 4 5 6 7 8 9 10 |
x |
The data. An object of class |
description |
Description for the Github gist, or leave to default (=no description) |
public |
(logical) Whether gist is public (default: |
browse |
If |
lon, lat |
(character) Longitude and latitude variable names. Ignored
unless |
name |
(character) the column name that contains the name to use in
creating the map. If left |
... |
Further arguments passed on to |
See gistr::gist_auth()
for help on authentication
Does not support adding a convex hull via hull()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ## Not run:
## spocc
library("spocc")
spp <- c('Danaus plexippus', 'Accipiter striatus', 'Pinus contorta')
dat <- spocc::occ(spp, from=c('gbif','ecoengine'), limit=30,
gbifopts=list(hasCoordinate=TRUE))
# Define colors
map_gist(dat, color=c('#976AAE','#6B944D','#BD5945'))
# Define colors and marker size
map_gist(dat, color=c('#976AAE','#6B944D','#BD5945'),
size=c('small','medium','large'))
# Define symbols
map_gist(dat, symbol=c('park','zoo','garden'))
## rgbif
if (requireNamespace("rgbif")) {
library("rgbif")
### occ_search() output
res <- occ_search(scientificName = "Puma concolor", limit = 100)
map_gist(res)
### occ_data() output
res <- occ_data(scientificName = "Puma concolor", limit = 100)
map_gist(res)
#### many taxa
res <- occ_data(scientificName = c("Puma concolor", "Quercus lobata"),
limit = 30)
res
map_gist(res)
}
## data.frame
df <- data.frame(name = c('Poa annua', 'Puma concolor', 'Foo bar'),
longitude = c(-120, -121, -121),
latitude = c(41, 42, 45), stringsAsFactors = FALSE)
map_gist(df)
### usage of occ2sp()
#### SpatialPoints
spdat <- occ2sp(dat)
map_gist(spdat)
#### SpatialPointsDataFrame
spdatdf <- as(spdat, "SpatialPointsDataFrame")
map_gist(spdatdf)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.