# 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)
# }
Run the code above in your browser using DataLab