]> git.donarmstrong.com Git - ape.git/blob - man/dist.gene.Rd
current 2.1 release
[ape.git] / man / dist.gene.Rd
1 \name{dist.gene}
2 \alias{dist.gene}
3 \alias{dist.gene.pairwise}
4 \alias{dist.gene.percentage}
5 \title{Pairwise Distances from Genetic Data}
6 \usage{
7 dist.gene(x, method = "pairwise", variance = FALSE)
8 dist.gene.pairwise(x, variance = FALSE)
9 dist.gene.percentage(x, variance = FALSE)
10 }
11 \arguments{
12   \item{x}{a matrix or a data frame.}
13   \item{method}{a character string specifying the method used to compute
14     the distances; only two choices are available: \code{"pairwise"},
15     and \code{"percentage"}.}
16   \item{variance}{a logical, indicates whether the variance of the
17     distances should be returned (default to FALSE).}
18 }
19 \description{
20   These functions compute a matrix of distances between pairs of
21   individuals from a matrix or a data frame of genetic data.
22 }
23 \details{
24   This function is meant to be very general and accepts different kinds
25   of data (alleles, haplotypes, DNA sequences, and so on). The rows of
26   the data matrix represent the individuals, and the columns the loci.
27
28   In the case of the pairwise method, the distance \eqn{d} between two
29   individuals is the number of loci for which they differ, and the
30   associated variance is \eqn{d(L - d)/L}, where \eqn{L} is the number
31   of loci.
32
33   In the case of the percentage method, this distance is divided by \eqn{L},
34   and the associated variance is \eqn{d(1 - d)/L}.
35
36   For more elaborate distances with DNA sequences, see the function
37   \code{dist.dna}.
38 }
39 \value{
40   either a numeric matrix with possibly the names of the individuals (as
41   given by the rownames of the argument \code{x}) as colnames and rownames
42   (if \code{variance = FALSE}, the default), or a list of two matrices names
43   \code{distances} and \code{variance}, respectively (if \code{variance =
44     TRUE}).
45 }
46 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
47 \seealso{
48   \code{\link{dist.dna}}, \code{\link{cophenetic.phylo}}
49 }
50 \keyword{manip}
51