write.tree: Write a newick formatted phylogenetic tree.

Description Usage Arguments Value Examples

Description

Write a newick formatted phylogenetic tree.

Usage

1
write.tree(tree = NULL, file = NULL)

Arguments

tree

A phylo object, as returned from read.tree. Also accepts a BIOM object if it has a phylogentic tree.

file

Filename or connection to write the newick file to (optional).

Value

If file is NULL, the newick string as a character vector. Otherwise, the return value from writeChar, typically invsible(NULL).

Examples

1
2
3
4
5
    library(rbiom)
    
    infile <- system.file("extdata", "newick.tre", package = "rbiom")
    tree   <- read.tree(infile)
    newick <- write.tree(tree)

rbiom documentation built on Nov. 5, 2021, 9:11 a.m.