read.tree: Read a newick formatted phylogenetic tree.

Description Usage Arguments Value Examples

Description

A phylogenetic tree is required for computing UniFrac distance matrices. You can load a tree either from a file or by providing the tree string directly. This tree must be in Newick format, also known as parenthetic format and New Hampshire format.

Usage

1
read.tree(src)

Arguments

src

Input data as either a file path, URL, or Newick string. URLs must begin with http://, https://, ftp://, or ftps://. Newick strings must have ( as their first non-whitespace character. Compressed (gzip or bzip2) Newick files are also supported.

Value

A phylo class object representing the tree.

Examples

1
2
3
4
5
6
7
8
9
    library(rbiom)
    
    infile <- system.file("extdata", "newick.tre", package = "rbiom")
    tree <- read.tree(infile)
    
    tree <- read.tree("
        (t9:0.99,((t5:0.87,t2:0.89):0.51,(((t10:0.16,(t7:0.83,t4:0.96)
        :0.94):0.69,(t6:0.92,(t3:0.62,t1:0.85):0.54):0.23):0.74,t8:0.1
        2):0.43):0.67);")

rbiom documentation built on July 2, 2020, 1:47 a.m.