rbladj: Run Phylocom's bladj from R

Description Usage Arguments Details Value Examples

View source: R/rbladj.R

Description

Run Phylocom's bladj from R

Usage

1
rbladj(tree, ages)

Arguments

tree

(character/phylo) One of: phylogeny as a newick string (will be written to a temp file) - OR path to file with a newick string - OR a an ape phylo object. required.

ages

(data.frame/character) ages data.frame, or path to an ages file. required.

Details

uses phylocomr::ph_bladj() under the hood

Value

Newick formatted tree as phylo object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
library("phylocomr")

# make an ages data.frame
ages_df <- data.frame(
  a = c('malpighiales','eudicots','ericales_to_asterales','plantaginaceae',
        'malvids', 'poales'),
  b = c(81, 20, 56, 76, 47, 71)
)

# read phylogeny file as a string
phylo_file <- system.file("examples/phylo_bladj", package = "phylocomr")
phylo_str <- readLines(phylo_file)

# Run Bladj, returns phylo object
(x <- rbladj(tree = phylo_str, ages = ages_df))

# load ape and plot tree
library(ape)
plot(x)

## End(Not run)

Example output

Attaching package: 'phylocomr'

The following object is masked from 'package:brranching':

    phylomatic


Phylogenetic tree with 14 tips and 13 internal nodes.

Tip labels:
	lomatium_concinnum, campanula_vandesii, veronica_candidissima, penstemon_paniculatus, justicia_oblonga, marsdenia_gilgiana, ...
Node labels:
	malpighiales, eudicots, , ericales_to_asterales, , , ...

Rooted; includes branch lengths.

brranching documentation built on May 11, 2021, 9:09 a.m.