Learn R Programming

rbiom (version 1.0.3)

write.tree: Write a newick formatted phylogenetic tree.

Description

Write a newick formatted phylogenetic tree.

Usage

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

Value

If file is NULL, the newick string as a character vector. Otherwise, the return value from writeChar, typically invsible(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).

Examples

Run this code
    library(rbiom)
    
    infile <- system.file("extdata", "newick.tre", package = "rbiom")
    tree   <- read.tree(infile)
    newick <- write.tree(tree)

Run the code above in your browser using DataLab