vegdist: Dissimilarity Matrices from 'Vegsoup*' Objects

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

Description

Compute a dissimilarity matrix as specified by vegdist(x) by internal calls to vegdist of vegan. Method distconnected is a wrapper for function distconnected also found in package vegan.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'Vegsoup'
as.dist(m, diag = FALSE, upper = FALSE)

## S4 method for signature 'Vegsoup'
vegdist(x, method = "bray", binary = FALSE, diag = FALSE,
	upper = FALSE, na.rm = FALSE, ...)

## S4 replacement method for signature 'Vegsoup'
vegdist(x) <- value

## S4 method for signature 'Vegsoup'
distconnected(dis, toolong, trace)

Arguments

x, m, dis

Vegsoup* object.

value

A single character valid as argument method to function vegdist of vegan.

diag, upper, na.rm

Compute diagonals or return only the upper diagonal.

method, binary

Not used.

...

For vegdist additional arguments passed to vegan::vegdist, except argument method which is inherited from the Vegsoup* object. For distconnected arguments passed to vegdist.

toolong

Shortest dissimilarity regarded as NA. See vegdist.

trace

Summarize results.

Details

Note, the method returned by decostand(obj) will be applied before calculation of the distance matrix. Use vegdist(obj) to query which method is active for an object. The print, show and summary methods will report this value for a Vegsoup* object.

If vegdist is rested using the replacement method vegdist<- for objects of classes 'VegsoupPartition' and 'VegsoupPartitionFidelity' the respective objects are recomputed as to honor the changed distance method.

Method distconnected is a simple wrapper for function distconnected in package vegan and checks for connectedness of dissimilarities.

Value

as.dist returns an object of class "dist" with an additional attribute "mode".

vegdist returns a "character", the distance index active for a Vegsoup* object.

distconnected returns an "integer" vector to identify connected groups.

Note

As vegan::vegdist, as.dist returns dissimilarities not distances. If the resulting "dist" object is not a dissimilarity matrix (max(D) > 1), it will be divided by max(D) to obtain dissimilarities.

Author(s)

Roland Kaiser

vegdist and distconnected are methods for functions in package vegan.

See Also

vegdist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require(vegsoup)

data(barmstein)
x <- barmstein

# query disssimlilarity measure set for the object
vegdist(x)

# change the default distance 'euclidean'
vegdist(x) <- "bray"

d <- as.dist(x, "numeric")
class(d)
attributes(d)
attr(d, "mode")

# replace vegdist method for VegsoupPartition object
x <- VegsoupPartition(barmstein, k = 2)
vegdist(x)
p1 <- partitioning(x)

# change vegdist
vegdist(x) <- "bray"
p2 <- partitioning(x)

table(p1, p2)

# R-mode analysis
# currently disfunct due to missing ... argument in stats:as.dist
# chi square distances can be obtained
# by computing euclidean distances on standardized data
# see ?vegan::vegdist

## Not run:  
# decostand(x)  <- "chi.square"
# d <- as.dist(dta, mode = "R")
# class(d)
# attr(d, "mode")

## End(Not run)

# connectivity of distances
distconnected(x)

vegsoup documentation built on Feb. 24, 2021, 3 a.m.