centroid: Centroids of row groups (vegetation releves)

Description Usage Arguments Value Note Author(s) References Examples

View source: R/centroid.R

Description

Given a two-dimensional data frame or matrix of vegetation data and group membership of rows (releve classification) a new matrix is derived with relative species frequency (0 to 1 scale) within groups. The matrix of centroids has as many rows as there are row groups in the vegetation matrix and the same number of columns (species).

Usage

1
2
3
4
5
6
centroid(nveg, grel,y,...)

## Default S3 method:
centroid(nveg, grel,y,...)
## S3 method for class 'centroid'
print(x,...)

Arguments

nveg

A data frame of vegetation releves (rows) by species (columns)

grel

A vector containing group membership of releves (rows), typically generated by hclust and cutree

y

Transformation of species scores: x'= x exp(y)

...

Further variables used for printing

x

A list of class "centroid" generated by centroid

Value

An output list of class "centroid" with at least the following items:

nrelgroups

Number of rows of centroid table

nspec

Number of columns of centroid table

freq.table

A table of species frequencies within groups, unadjusted

prob.table

A table of species frequencies within groups, adjusted (0-1)

dist.mat

An nrelgroups by nrelgroups distance matrix of centroids

Note

In function Mtabs() buit in as summary method

Author(s)

Otto Wildi

References

Wildi, O. 2017. Data Analysis in Vegetation Ecology. 3rd ed. CABI, Oxfordshire, Boston.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# This generates a typical artificial vegetation data frame aveg
v1<- matrix(rep(0,200),nrow=10)        
diag(v1)<-1 ; diag(v1[,2:12])<-1 ; diag(v1[,3:13])<-2 ; diag(v1[,4:14])<-1
diag(v1[,5:15])<-1 ; diag(v1[5:8,3:6])<-3 ; aveg<- data.frame(v1[,2:13])

# First, groups of releves are formed by cluster analysis
require(vegan)
dr<- vegdist(aveg^0.5,method="bray")      # dr is distance matrix of rows
o.clr<- hclust(dr,method="ward")          # this is clustering
grel<- cutree(o.clr,k=3)                  # 3 row groups formed
o.centroid<- centroid(aveg,grel,y=0.5)
o.centroid                                # printing the matrix

dave documentation built on May 2, 2019, 1:30 p.m.