vardist {labdsv}R Documentation

Variable Pairwise Difference

Description

Calculates a matrix of pair-wise differences between value for a particular numeric variable for a dataset.

Usage

vardist(x)

Arguments

x a vector of numeric values

Details

Calculates the absolute value of the difference between all possible values in a vector, producing a matrix of differences with as many rows and columns as the length of the vector

Value

an object of class dist

Note

This function can be used to compare the compositional differences among samples to the environmental differences by correlation or regression, or perhaps other routines.

Author(s)

David W. Roberts droberts@montana.edu http://ecology.msu.montana.edu/labdsv

References

http://ecology.montana.msu.edu/labdsv/

Examples

    data(bryceveg) # returns a vegetation data.frame called bryceveg
    data(brycesite) # returns an environmental data.frame called brycesite
    dis.bc <- dsvdis(bryceveg,'bray/curtis') # returns a Bray/Curtis dissimilarity matrix
    dis.elev <- vardist(brycesite$elev) # matrix of pair-wide differences in elevation
    cor(as.vector(dis.bc),as.vector(dis.elev))

[Package labdsv version 1.0-1 Index]