sim: Calculate similarities for binary vegetation data

View source: R/sim.R

simR Documentation

Calculate similarities for binary vegetation data

Description

This function is from the package simba. One of 56 (dis)similarity measures for binary data can be set to calculate (dis)similarities. The vegetational data can be in either database (list) or matrix format. Same holds for the output. Simultaneous calculation of geographical distances between plots and the virtual position of the calculated similarity values between the parental units can be achieved if a data.frame with coordinates is given.

Usage

sim(
  x,
  coord = NULL,
  method = "soer",
  dn = NULL,
  normalize = FALSE,
  listin = FALSE,
  listout = FALSE,
  ...
)

Arguments

x

Vegetation data, either as matrix with rows = plots and columns = species (similarities are calculated between rows!), or as data.frame with first three columns representing plots, species and occurence information respectively. All further columns are dumped before calculation. Occurence is only considered as binary. If your list or matrix contains abundances or frequencies they are transformed automatically.

coord

A data.frame with two columns containing the coordinate values of the sampling units. If given, it triggers the simultaneous calculation of the geographical distances between the sampling units, the coordinates of virtual centre-points between all possible pairs of plots, and the geographical distances in either x- or y-direction. If coord is given, output is always in database format (no matrix).

method

Binary Similarity index (see Details for references and formulae), partial match to "soerensen", "jaccard", "ochiai", "mountford", "whittaker", "lande", "wilsonshmida", "cocogaston", "magurran", "harrison", "cody", "williams", "williams2", "harte", "simpson", "lennon", "weiher", "ruggiero", "lennon2", "rout1ledge", "rout2ledge", "rout3ledge", "sokal1", "dice", "kulcz1insky", "kulcz2insky", "mcconnagh", "manhattan", "simplematching", "margaleff", "pearson", "roger", "baroni", "dennis", "fossum", "gower", "legendre", "sokal2", "sokal3", "sokal4", "stiles", "yule", "michael", "hamann", "forbes", "chisquare", "peirce", "eyraud", "simpson2", "legendre2", "fager", "maarel", "lamont", "johnson", "sorgenfrei", "johnson2". See details.

dn

Neighbor definition. A geographic distance represented by a numeric or a two value vector defining a ring around each plot. Only takes effect when coord != NULL. If specified, the output does only contain similarities between neighboring plots. A plot is a neighbour to any given plot if it is within the range of the neighbor definition. See details.

normalize

Logical value indicating whether the values for a, b and c which are calculated in the process should be normalized to 100% (per row, which means per plot comparison). If normalize = TRUE an asymmetric index must be chosen (see details).

listin

if x is given in database (list) format this must be set to TRUE (there is no automatic detection of the format)

listout

If output is wanted in database format rather than as a dist-object set this to TRUE. Output is automatically

...

given in database-format, when coord is specified.

Value

If listout = FALSE a distance matrix of class dist is returned. If listout = TRUE, a data.frame is returned with 7 columns giving the names of the compared plots in the first two and the calculated similarity measure in the third column. The rest of the columns give the values for a, b, c, and d (in this order). Naming of the first three columns can be changed but defaults to NBX (one of the compared plots), NBY (the other one), used index (the values of the calculated index). If coord != NULL, the following columns are given in addition and the columns a:d shift to the end of the data.frame.

Examples

require(leaflet)
tmp <- makesq(coordID = c(645260), projection = "WGS")
leaflet() %>%
  addTiles() %>%
  addPolygons(data = tmp)









TobiasRoth/BDM documentation built on June 12, 2024, 7:16 a.m.