Learn R Programming

rbiom (version 1.0.0)

write.tree: Write a newick formatted phylogenetic tree.

Description

Write a newick formatted phylogenetic tree.

Usage

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

Run this code
# NOT RUN {
    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