sim.yo: Calculate a binary similarity index you define.

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Enables the calculation of any binary similarity index via the provision of a formula.

Usage

1
2
sim.yo(x, coord = NULL, method = "(2*a)/((2*a) + b + c)", 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

Give the formula for a binary similarity index. Defaults to the formula of Sørensen index. See sim for more examples and general explanations.

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 in sim).

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.

...

Arguments to other functions

Details

Presumably this function will rarely be used because sim already allows for the calculation of a large variety of binary similarity coefficients. But just in case you found or thought of an alternative this function is provided. For details regarding similarity indices see sim. You have to give your formula in quotation marks like this: "(2*a)/((2*a) + b + c)".

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.

distance

Geographical distance between compared plots

X

For plotting purposes, the x-coordinate of the virtual position of the calculated similarity value in the center between the two compared plots

Y

For plotting purposes, the y-coordinate of the virtual position of the calculated similarity value in the center between the two compared plots

xdist

Geographical distance between compared plots, on the x-axis only

ydist

Geographical distance between compared plots, on the y-axis only

Note

In general, concepts of data-handling are taken from vegdist and the calculation of a, b, c and d is taken from dist.binary. Thanks to Jari Oksanen for his vegan package and the idea to provide a custom build distance formula.

Author(s)

Gerald Jurasinski gerald.jurasinski@uni-rostock.de

References

Sørensen, T. (1948) A method of establishing groups of equal amplitude in plant sociology based on similarity of species content. Biologiske Skrifter 5: 1-34.

See Also

vegdist, designdist, dist.binary, dsvdis, dist for other dissimilarity coefficients, and sim for a variety of formulae for similarity coefficients.

Examples

1
2
3
4
5
6
7
data(abis)

##calculate the default Sørensen index
abis.soer <- sim.yo(abis.spec)

##calculate a custom similarity index
abis.sim <- sim.yo(abis.spec, method="(2*a)/((a) + b + c)")

simba documentation built on May 1, 2019, 8:49 p.m.