label_pad: Padding taxa labels

View source: R/geom_tiplab.R

label_padR Documentation

Padding taxa labels

Description

This function adds padding characters to the left side of taxa labels, adjust their length to the longest label.

Usage

label_pad(label, justify = "right", pad = "ยท")

Arguments

label

taxa label

justify

should a character vector be right-justified (default), left-justified, centred or left alone.

pad

padding character (defaults to dots)

Value

Taxa labels with padding characters added

Author(s)

Guangchuang Yu and Yonghe Xia

References

https://groups.google.com/g/bioc-ggtree/c/INJ0Nfkq3b0/m/lXefnfV5AQAJ

Examples

library(ggtree)
set.seed(2015-12-21)
tree <- rtree(5)
tree$tip.label[2] <- "long string for test"
label_pad(tree$tip.label)

YuLab-SMU/ggtree documentation built on Nov. 3, 2024, 4:15 p.m.