read.any.tree: Read any tree

View source: R/read.any.tree.R

read.any.treeR Documentation

Read any tree

Description

Reads any type of tree, whether it's a nexus or newick one.

Usage

read.any.tree(file, ...)

Arguments

file

a file name specified by either a variable of mode character, or a double-quoted string.

...

any optional arguments to be passed to read.nexus or read.tree.

Author(s)

Thomas Guillerme

Examples

## Generating a single newick file
newick <- "(((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);"
cat(newick, file = "example_newick.tre", sep = "\n")
## Reading a single newick file
read.any.tree("example_newick.tre")
## Removing the file
unlink("example_newick.tre")

## Generating a multiple nexus file
ape::write.nexus(ape::rmtree(2,3), file = "example_multi_nexus.nex")
## Reading a multiple nexus file
read.any.tree("example_multi_nexus.nex")
## Removing the file
unlink("example_multi_nexus.nex") 


TGuillerme/Inapp documentation built on Feb. 4, 2024, 7:26 a.m.