read_phyloxml: Read phyloXML files

Description Usage Arguments Details Value Examples

View source: R/read_phyloxml.R

Description

Read phyloXML files

Usage

1
2
3
4
5
6
7
read_phyloxml(x, ...)

## S3 method for class 'character'
read_phyloxml(x, ...)

## Default S3 method:
read_phyloxml(x, ...)

Arguments

x

Either a character scalar (path to a phyloXML file) or an xml object.

...

Further arguments passed to xml2::read_xml

Details

phyloxml objects can be coerced as ape::multiphylo using the phyloxml2phylo function.

Value

A list of class phyloxml in which each element represents a tree: A data.frame with the following elements:

id

Integer, the id of the node.

name

Character, the name of the node (can be NA).

branch_length

Numeric, the length of the branch (can be NA).

iselaf

Logical, whether it is leaf (tip) or not.

parent

Integer, the id of the parent node.

Examples

1
2
3
4
5
6
library(ape)
set.seed(1)

x <- rtree(10)
x2 <- write_phyloxml(x)
read_phyloxml(x2)

USCbiostats/rphyloxml documentation built on Nov. 2, 2020, 11:38 a.m.