Description Usage Arguments Value Examples
Visualize biodiversity records
1 |
x |
an object of class 'phylodiv' |
type |
visualization type, one of count, facet, raster |
... |
further arguments passed on to [choroplethr::country_choropleth()] (type=facet), [rgbif::map_fetch()] (type=raster) |
a plot
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:
library(ape)
data(chiroptera)
st <- ape::subtrees(chiroptera)[[393]]
x <- pd_read(st)
res <- pd_taxa(x)
spp <- c("Eptesicus serotinus", "Eptesicus fuscus",
"Eptesicus furinalis", "Eptesicus brasiliensis")
res <- pd_query(res, spp)
# skip pd_biodiv to go directly to pd_vis
pd_vis(res, "raster")
# export
png("myplot.png")
pd_vis(x)
dev.off()
# facet counts on map by category, e.g., country
library(ape)
data(chiroptera)
st <- ape::subtrees(chiroptera)[[393]]
x <- pd_read(st)
res <- pd_taxa(x)
spp <- c("Eptesicus serotinus", "Eptesicus fuscus",
"Eptesicus furinalis", "Eptesicus brasiliensis")
res <- pd_query(res, spp)
biodiv <- pd_biodiv(res, type = 'facet', by = "country")
biodiv
biodiv$data
pd_vis(biodiv, type = "facet")
# counts plotted on tree
library(ape)
data(chiroptera)
st <- ape::subtrees(chiroptera)[[393]]
x <- pd_read(st)
res <- pd_taxa(x)
spp <- c("Eptesicus serotinus", "Eptesicus fuscus",
"Eptesicus furinalis", "Eptesicus brasiliensis")
res <- pd_query(res, spp)
counts <- pd_biodiv(res, type = 'count')
pd_vis(counts, type = "count")
res <- pd_query(res, res$tree$tip.label)
counts <- pd_biodiv(res, type = 'count')
pd_vis(counts, type = "count")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.