geo_sim | R Documentation |
Lm for sample similarity and geographical distance
geo_sim(otutab, geo, method = "bray", spe_nwk = NULL, ...)
otutab |
an otutab data.frame, samples are columns, taxs are rows. |
geo |
a two-columns dataframe, first is latitude, second is longitude |
method |
Dissimilarity index, partial match to "bray", "euclidean"...see |
spe_nwk |
a phylo tree if use unifrac... |
... |
additional |
a ggplot
Graco-Roza, C. et al. (2022) Distance decay 2.0 - A global synthesis of taxonomic and functional turnover in ecological communities. Glob Ecol Biogeogr 31, 1399–1421.
if (requireNamespace("NST") && requireNamespace("geosphere")) {
library(ggplot2)
data(otutab, package = "pcutils")
metadata[, c("lat", "long")] -> geo
geo_sim(otutab, geo) -> geo_res
pcutils::my_lm(geo_res[4], "dis.geo", geo_res)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.