Learn R Programming

simba (version 0.3-4)

bcoov: Calculate Bray-Curtis distance for only one variable

Description

Calculates Bray-Curtis distance for only one variable: How dissimilar are the units regarding for instance pH?

Usage

bcoov(x, names, listout = FALSE)

Arguments

x
numeric vector with quantitative data from sampling-units, standardization may be applied before
names
where should the names be taken from, must be a vector of the same length as x and should give the names of the sampling-units
listout
Shall the result given in list-format (data.frame)? Defaults to FALSE

Value

  • Returns a dist object or a data.frame (in the case of listout = TRUE) with
  • NBXone of the compared sampling units
  • NBYthe other part of the pair
  • xThe returned distance value. It is named like the tested variable

encoding

UTF-8

Details

It is just a simple way to calculate similarity based on only one variable. In the future there might be a possibility to choose from some functions. However, you could also use the difference in the data-values instead (which is the Euclidean distance in one dimensional space).

See Also

vegdist, dist.quant, dsvdis

Examples

Run this code
data(abis)
names(abis.env) ##take a look at the data
##calculate the similarity (Bray-Curtis) between the plots 
##regarding pH
pH.dist <- bcoov(abis.env$pH, names=rownames(abis.env))

## directly give it as a list (data.frame)
pH.dist.ls <- bcoov(abis.env$pH, names=rownames(abis.env)
, listout=TRUE)

Run the code above in your browser using DataLab