Learn R Programming

phangorn (version 2.8.1)

writeDist: Writing and reading distances in phylip and nexus format

Description

readDist, writeDist and write.nexus.dist are useful to exchange distance matrices with other phylogenetic programs.

Usage

writeDist(x, file = "", format = "phylip", ...)

write.nexus.dist(x, file = "", append = FALSE, upper = FALSE, diag = TRUE, digits = getOption("digits"), taxa = !append)

readDist(file, format = "phylip")

read.nexus.dist(file)

# S3 method for dist unique(x, incomparables, ...)

Arguments

x

A dist object.

file

A file name.

format

file format, default is "phylip", only other option so far is "nexus".

Further arguments passed to or from other methods.

append

logical. If TRUE the nexus blocks will be added to a file.

upper

logical value indicating whether the upper triangle of the distance matrix should be printed.

diag

logical value indicating whether the diagonal of the distance matrix should be printed.

digits

passed to format inside of write.nexus.dist.

taxa

logical. If TRUE a taxa block is added.

incomparables

Not used so far.

Value

an object of class dist

References

Maddison, D. R., Swofford, D. L. and Maddison, W. P. (1997) NEXUS: an extensible file format for systematic information. Systematic Biology, 46, 590--621.

See Also

To compute distance matrices see dist.ml dist.dna and dist.p for pairwise polymorphism p-distances

Examples

Run this code
# NOT RUN {
data(yeast)
dm <- dist.ml(yeast)
writeDist(dm)
write.nexus.dist(dm)

# }

Run the code above in your browser using DataLab