]> git.donarmstrong.com Git - ape.git/blob - man/dist.gene.Rd
various corrections
[ape.git] / man / dist.gene.Rd
1 \name{dist.gene}
2 \alias{dist.gene}
3 \title{Pairwise Distances from Genetic Data}
4 \usage{
5 dist.gene(x, method = "pairwise", pairwise.deletion = FALSE,
6           variance = FALSE)
7 }
8 \arguments{
9   \item{x}{a matrix or a data frame.}
10   \item{method}{a character string specifying the method used to compute
11     the distances; two choices are available: \code{"pairwise"} and
12     \code{"percentage"}, or any unambiguous abbreviation of these.}
13   \item{pairwise.deletion}{a logical indicating whether to delete the
14     columns with missing data on a pairwise basis. The default is to
15     delete the columns with at least one missing observation.}
16   \item{variance}{a logical, indicates whether the variance of the
17     distances should be returned (default to \code{FALSE}).}
18 }
19 \description{
20   This function computes 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, SNP, DNA sequences, \dots). 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 \note{
40   Missing data (\code{NA}) are coded and treated in R's usual way.
41 }
42 \value{
43   an object of class \code{dist}. If \code{variance = TRUE} an
44   attribute called \code{"variance"} is given to the returned object.
45 }
46 \author{Emmanuel Paradis}
47 \seealso{
48   \code{\link{dist.dna}}, \code{\link{cophenetic.phylo}},
49   \code{\link[stats]{dist}}
50 }
51 \keyword{manip}
52