Learn R Programming

dartR (version 1.1.11)

gl2phylip: Create a Phylip input distance matrix from a genlight (SNP) or genind (SilicoDarT) {adegenet} object

Description

This function calculates and returns a matrix of Euclidean distances between populations and produces an input file for the phylogenetic program Phylip (Joe Felsenstein).

Usage

gl2phylip(gl, outfile = "phyinput.txt", outpath = tempdir(),
  bstrap = 1)

Arguments

gl

Name of the genlight object containing the SNP data or a genind object containing presence absence data [required]

outfile

Name of the file to become the input file for phylip [default phyinput.txt]

outpath

path where to save the output file (set to tempdir by default)

bstrap

Number of bootstrap replicates [default 1]

Value

Matrix of Euclidean distances between populations

Examples

Run this code
# NOT RUN {
result <- gl2phylip(testset.gl, outfile="test.txt", bstrap=10)
# }

Run the code above in your browser using DataLab