3 \title{Pairwise Distances from Genetic Data}
5 dist.gene(x, method = "pairwise", pairwise.deletion = FALSE,
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}).}
20 This function computes a matrix of distances between pairs of
21 individuals from a matrix or a data frame of genetic data.
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.
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
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}.
36 For more elaborate distances with DNA sequences, see the function
40 Missing data (\code{NA}) are coded and treated in R's usual way.
43 an object of class \link[stats]{"dist"}. If \code{variance = TRUE} an
44 attribute called \code{"variance"} is given to the returned object.
46 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
48 \code{\link{dist.dna}}, \code{\link{cophenetic.phylo}},
49 \code{\link[stats]{dist}}