Rgendist: R interface for gendist

Description Usage Arguments Details Value Author(s) References See Also

View source: R/Rphylip.R


This function is an R interface for gendist in the PHYLIP package (Felsenstein 2013). gendist can be used to estimate the evolutionary distances between populations based on gene frequency data. Three methods can be used for computing these distances. These are (1) Nei's genetic distance (Nei 1972), (2) Cavalli-Sforza's chord measure (Cavalli-Sforza & Edwards 1967), and (3) Reynolds et al.'s (1983) genetic distance.


Rgendist(X, path=NULL, ...)



either: (a) A matrix of allele frequencies (in columns) with rownames containing species names. In this case it is assumed that m - 1 allele frequencies are reported for a locus with m segregating alleles. (The mth frequency is just one minus the sum of the other m-1.) Or (b) a list of matrices in which each row contains the relative frequency of alleles at a locus for a species. In this case, the rownames of each matrix in the list should contain the species names. Here the number of alleles at each locus can be inferred from the number of columns in the matrix, and no frequencies should be omitted. (I.e., rows should add to 1.0.)


path to the executable containing gendist. If path = NULL, the R will search several paths for gendist. See details for more information.


optional arguments to be passed to gendist. See details for more information.


Optional arguments include the following: quiet suppress some output to R console (defaults to quiet = FALSE); method, the method for calculating the genetic distance - options are "Nei", "Cavalli-Sforza", and "Reynolds" (defaults to method="Nei"); nalleles a vector containing the number of alleles per locus in X (not used if X is a list, and assumed to be a vector of 2s if ommitted); and cleanup remove PHYLIP input & output files after the analysis is completed (defaults to cleanup = TRUE).

More information about the gendist program in PHYLIP can be found here http://evolution.genetics.washington.edu/phylip/doc/gendist.html.

Obviously, use of any of the functions of this package requires that PHYLIP (Felsenstein 1989, 2013) should first be installed. Instructions for installing PHYLIP can be found on the PHYLIP webpage: http://evolution.genetics.washington.edu/phylip.html.


This function returns an object of class "dist".


Liam J. Revell, Scott A. Chamberlain

Maintainer: Liam J. Revell <[email protected]>


Cavalli-Sforza, L.L., Edwards, A.W.F. (1967) Phylogenetic analysis: models and estimation procedures. Evolution, 32, 550-570.

Felsenstein, J. (1989) PHYLIP–Phylogeny Inference Package (Version 3.2). Cladistics, 5, 164-166.

Felsenstein, J. (2013) PHYLIP (Phylogeny Inference Package) version 3.695. Distributed by the author. Department of Genome Sciences, University of Washington, Seattle.

Nei, M. (1972) Genetic distance between populations. American Naturalist, 106, 283-292.

Reynolds, J.B., Weir, B.S., Cockerham, C.C. (1983) Estimation of the coancestry coefficient: basis for a short-term genetic distance. Genetics, 105, 767-779.

See Also

Rdnadist, Rprotdist

Rphylip documentation built on May 30, 2017, 2:43 a.m.