tree.load.data: Loads a data.frame or CSV file into a tree as tags. Requires...

Description Usage Arguments Value Examples

Description

Loads a data.frame or CSV file into a tree as tags. Requires a 'label' column in the source data, which is used to merge rows in the dataset to labeled nodes in the tree.

Usage

1
  tree.load.data(phylo, x, ...)

Arguments

phylo

input phylo object

x

input data.frame or string indicating the location of a CSV file.

Value

the phylo object, with tags corresponding to the data from the input dataset.

Examples

1
2
3
4
5
6
7
8
tree <- tree.read('((a,b)c,d)e;')
x <- data.frame(
  label=c('a', 'b', 'c', 'd', 'e'),
  value=c(1, 2, 3, 4, 5)
)
tree <- tree.load.data(tree, x)
print(as.character(tree)) # as NHX string
print(as.data.frame(tree, minimal.columns=TRUE)) # as data.frame

gjuggler/ggphylo documentation built on May 17, 2019, 6:05 a.m.