ortho.Rd 2.37 KB
Newer Older
Eric Coissac committed
1 2 3 4
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariate.R
\name{ortho}
\alias{ortho}
5 6 7
\alias{ortho.dist}
\alias{ortho.matrix}
\alias{ortho.data.frame}
8
\alias{ortho.procmod_frame}
Eric Coissac committed
9 10 11
\title{Project a dataset in a euclidean space.}
\usage{
ortho(data, ...)
12

13
\method{ortho}{dist}(data, tol = 1e-07, ...)
14

15
\method{ortho}{matrix}(data, scale = FALSE, ...)
16

17
\method{ortho}{data.frame}(data, scale = FALSE, ...)
18

19
\method{ortho}{procmod_frame}(data, ...)
20 21 22 23
}
\arguments{
\item{data}{a numeric matrix describing the points}

24 25
\item{...}{other parameters specific to some implementation}

26 27 28 29 30 31 32 33 34 35 36
\item{tol}{a tolerance threshold : an eigenvalue is
considered positive if it is larger than
-tol*lambda1 where lambda1 is the largest eigenvalue.}

\item{scale}{a \code{logical} value indicating if the dimensions must be scaled
to force for every column that \code{sd=1}. \code{FALSE} by default.}
}
\value{
a numeric matrix with at most \code{n-1} dimensions, with
        \code{n} the number pf observations. This matrix defines the
        coordinates of each point in the orthogonal space.
Eric Coissac committed
37 38 39 40 41 42 43 44 45
}
\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 \code{\link[ProcMod]{pcoa}} function,
for other distance the \code{\link[ProcMod]{nmds}} is used.
When points are described by a set of variable the
\code{\link[ProcMod]{nmds}} is used.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
}
\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)

Eric Coissac committed
74 75 76 77 78 79
}
\author{
Eric Coissac

Christelle Gonindard-Melodelima
}