PhyloDiv: PhyloDiv and PhyloDivOne classes

Description Public fields Methods Examples

Description

PhyloDiv and PhyloDivOne classes

PhyloDiv and PhyloDivOne classes

Public fields

trees

(list) list of phylogenetic trees

query

(character) query string

data

ignored for now

Methods

Public methods


Method print()

print method for 'PhyloDivOne' objects

Usage
PhyloDiv$print(x, ...)
Arguments
x

self

...

ignored


Method new()

Create a new 'PhyloDiv' object

Usage
PhyloDiv$new(...)
Arguments
...

any number of 'PhyloDivOne' objects

Returns

A new 'PhyloDiv' object


Method add_tree()

add a tree

Usage
PhyloDiv$add_tree(tree)
Returns

nothing, adds a tree


Method fetch_hierarchies()

fetch hierarchy data for all trees

Usage
PhyloDiv$fetch_hierarchies()
Returns

list


Method to_list()

coerce to a list

Usage
PhyloDiv$to_list()
Returns

list of lists


Method to_json()

coerce to JSON

Usage
PhyloDiv$to_json(...)
Returns

json/character


Method clone()

The objects of this class are cloneable with this method.

Usage
PhyloDiv$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(ape)
set.seed(132434)
tree <- rcoal(20)
pd1 <- PhyloDivOne$new(tree)
pd1
pd1$to_list()
pd1$to_json()

x <- "((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3);"
tree <- read.tree(text = x)

# xxx
x <- PhyloDiv$new(pd1, pd1, pd1)
x
x$to_list()
x$to_json()
x$to_json(pretty = TRUE)

## End(Not run)

ropensci/phylodiv documentation built on March 13, 2020, 3:14 p.m.