nmds.Rd 1.63 KB
Newer Older
Eric Coissac committed
1 2 3 4 5 6
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariate.R
\name{nmds}
\alias{nmds}
\title{Project a distance matrix in a euclidean space (NMDS).}
\usage{
7
nmds(distances, maxit = 100, trace = FALSE, tol = 0.001, p = 2)
Eric Coissac committed
8
}
9 10 11 12 13 14 15 16 17 18 19 20 21
\arguments{
\item{distances}{a \code{\link[stats]{dist}} object or a
\code{\link[base]{matrix}}
object representing a distance matrix.}

\item{maxit}{The maximum number of iterations.}

\item{trace}{Logical for tracing optimization. Default \code{TRUE}.}

\item{tol}{convergence tolerance.}

\item{p}{Power for Minkowski distance in the configuration space.}
}
22 23 24 25 26
\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
27 28 29 30 31
\description{
Project a set of points defined by a distance matrix in
an eucleadean space using the Kruskal's Non-metric
Multidimensional Scaling. This function is mainly a simplified
interface on the \code{\link[MASS]{isoMDS}} function using as
32
much as possible dimensions to limit the stress. The aims of this
Eric Coissac committed
33 34 35
NDMS being only to project point in an orthogonal space therefore
without any correlation between axis. Because a non-metric method
is used no condition is required on the used distance.
36 37 38 39 40 41 42 43 44 45 46 47
}
\examples{
data(bacteria)
bacteria_rel_freq <- sweep(bacteria,
                           1,
                           rowSums(bacteria),
                           "/")
bacteria_hellinger <- sqrt(bacteria_rel_freq)
bacteria_dist <- dist(bacteria_hellinger)

project <- nmds(bacteria_dist)

Eric Coissac committed
48 49 50 51 52 53
}
\author{
Eric Coissac

Christelle Gonindard-Melodelima
}