dist.tmp: Calculate the distance between the instances or variables of...

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

Description

The function calculates the distance between the instances or variables of two data-sets, preferably two recordings from the same places/variables at different time steps. Could for example be useful to calculate the dissimilarity of species records from the same set of plots at different recording campaigns.

Usage

1
dist.tmp(x, y, method = "euclidean", margin = 1, adjust=TRUE)

Arguments

x

data.frame with numeric columns giving the data at time one

y

data.frame with numeric columns giving the data at time two

method

Which distance measure should be employed? The following measurees are available: "manhattan", "euclidean", "bray", "canberra", "kulczynski", "gower", "jaccard". See details.

margin

Shall the distance between the instances (rows, margin = 2), or the distance between the variables (columns, margin = 1) be calculated?

adjust

The default adjust = TRUE takes care of your input data. However, instances and variable names have to be unique, as the matching relies on these names. If your data meets this requirement the function automatically detects which instances and variables can be found in both data-sets and calculates the distance based on these data.

Details

The function provides just an alternative to code your repeated measurements from the same plots, calculate the distances between all instcances and sort out the distances between the same instances at different time steps. Here just the latter is calculated directly.

For details regarding the different distance coefficients, see vegdist. The formulae behind were taken from there. However, not all choices have been implemented here.

Value

Returns a vector of distances. Length depends on margin. If you choose margin = 1 it equals the number of instances (plots) in your two data-sets. If you choose margin = 2 it equals the number of variables (species) in your data-sets.

Author(s)

Gerald Jurasinski gerald.jurasinski@uni-rostock.de

References

See references in vegdist

See Also

vegdist, dist, sim

Examples

1
2
3
4
5
6
data(abis)

##just to see that the function takes care of matching instances 
##and variables we compare abis.spec with a permuted version of
##itself and skip some instances and variables in the original matrix.
dist.tmp(abis.spec[5:50,3:120], apply(abis.spec, 2, sample), method="bray")

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