| ortho {ProcMod} | R Documentation | 
Project a dataset in a euclidean space.
Description
Project a set of points defined by a distance matrix
or a set of variables in an eucleadean space.
If the distance matrix is a metric, this is done using
the pcoa function,
for other distance the nmds is used.
When points are described by a set of variable the
nmds is used.
Usage
ortho(data, ...)
## S3 method for class 'dist'
ortho(data, tol = 1e-07, ...)
## S3 method for class 'matrix'
ortho(data, scale = FALSE, ...)
## S3 method for class 'data.frame'
ortho(data, scale = FALSE, ...)
## S3 method for class 'procmod_frame'
ortho(data, ...)
Arguments
data | 
 a numeric matrix describing the points  | 
... | 
 other parameters specific to some implementation  | 
tol | 
 a tolerance threshold : an eigenvalue is considered positive if it is larger than -tol*lambda1 where lambda1 is the largest eigenvalue.  | 
scale | 
 a   | 
Value
a numeric matrix with at most n-1 dimensions, with
n the number pf observations. This matrix defines the
coordinates of each point in the orthogonal space.
Author(s)
Eric Coissac
Christelle Gonindard-Melodelima
Examples
library(vegan)
data(bacteria)
data(eukaryotes)
data(soil)
dataset <- procmod_frame(euk = vegdist(decostand(eukaryotes,
                                                 method = "hellinger"),
                                       method = "euclidean"),
                         bac = vegdist(decostand(bacteria,
                                                 method = "hellinger"),
                                       method = "euclidean"),
                         soil = scale(soil,
                                      center = TRUE,
                                      scale  = TRUE))
dp <- ortho(dataset)
bacteria_rel_freq <- sweep(bacteria,
                           1,
                           rowSums(bacteria),
                           "/")
bacteria_hellinger <- sqrt(bacteria_rel_freq)
bacteria_dist <- dist(bacteria_hellinger)
project <- ortho(bacteria_dist)