Learn R Programming

rphast (version 1.6.9)

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

Description

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

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.

Examples

Run this code
# NOT RUN {
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