Learn R Programming

pctax (version 0.1.3)

geo_sim: Lm for sample similarity and geographical distance

Description

Lm for sample similarity and geographical distance

Usage

geo_sim(otutab, geo, method = "bray", spe_nwk = NULL, ...)

Value

a ggplot

Arguments

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 vegdist;unifrac

spe_nwk

a phylo tree if use unifrac...

...

additional

References

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.

Examples

Run this code
if (requireNamespace("geosphere")) {
  library(ggplot2)
  data(otutab, package = "pcutils")
  metadata[, c("lat", "long")] -> geo
  geo_sim(otutab, geo) -> geo_res
}

Run the code above in your browser using DataLab