geo_sim: Lm for sample similarity and geographical distance

View source: R/b_analyse.R

geo_simR Documentation

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, ...)

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

Value

a ggplot

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

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)
}

pctax documentation built on May 29, 2024, 10:03 a.m.