nodeplotdefault: Generates a default node-label function

Description Usage Arguments Value See Also Examples

View source: R/plot-methods.R

Description

Is not a labeling function itself, but returns one. The returned function is capable of adding whatever label is on a node. Note that the function that is returned has two completely different arguments to those listed here: the plot object already built by earlier steps in plot_tree, and the data.frame that contains the relevant plotting data for the nodes (especially x, y, label), respectively. See nodeplotboot for a more sophisticated example. The main purpose of this and nodeplotboot is to provide a useful default function generator for arbitrary and bootstrap node labels, respectively, and also to act as examples of functions that will successfully interact with plot_tree to add node labels to the graphic.

Usage

1
nodeplotdefault(size=2L, hjust=-0.2)

Arguments

size

(Optional). Numeric. Should be positive. The size parameter used to control the text size of taxa labels. Default is 2. These are ggplot2 sizes.

hjust

(Optional). The horizontal justification of the node labels. Default is -0.2.

Value

A function that can add a node-label layer to a graphic.

See Also

nodeplotboot

nodeplotblank

plot_tree

Examples

1
2

Example output

function (p, nodelabdf) 
{
    p = p + geom_text(mapping = aes(x = x, y = y, label = label), 
        data = nodelabdf, size = size, hjust = hjust, na.rm = TRUE)
    return(p)
}
<environment: 0xf4fdb00>
function (p, nodelabdf) 
{
    p = p + geom_text(mapping = aes(x = x, y = y, label = label), 
        data = nodelabdf, size = size, hjust = hjust, na.rm = TRUE)
    return(p)
}
<environment: 0xf4ff198>

phyloseq documentation built on Nov. 8, 2020, 6:41 p.m.