Learn R Programming

rphast (version 1.0)

fix.semicolon.tree: Add a semi-colon to end of tree string...

Description

Add a semi-colon to end of tree string

Usage

fix.semicolon.tree(x)

Arguments

x
A character string or vector of character strings each representing a tree in Newick format.

Value

  • The same value, but with a semi-colon added to the end of any strings which did not already end in semi-colons.

Details

Check if tree string ends in semi-colon and if not add one. This is mostly done for compatibility with ape, which requires them.

Examples

Run this code
str <- c("213", "345")
fix.semicolon.tree(str)
str <- c("213;", "345;")
fix.semicolon.tree(str)
str <- c("213", "345;")
fix.semicolon.tree(str)

Run the code above in your browser using DataLab