plot_taxa {fossilbrush} | R Documentation |
plot_taxa
Description
Function to plot the parent or child relationships of an element in a hierarchically organised dataframe. Multiple taxa can be plotted simultaneously
Usage
plot_taxa(
x,
taxon,
trank,
ranks,
mode = c("parent", "child", "all"),
step = NULL
)
Arguments
x |
a dataframe containing hierarchically organised data in columns |
taxon |
A character vector of element names whose relationships will be plotted (these must be of the same rank) |
trank |
A character vector of length one corresponding to the column name in x in which taxa is located |
ranks |
A character vector corresponding to the column names in x, given in hierarchical order |
mode |
The direction of the relationships to be plotted |
step |
A positive integer specifinyg the neighbourhood of the relationships to plot. Specifying a number greater than the number of ranks will not cause a failure, and will instead plot all relationships in the direction specified in mode |
Value
A plot of the relationships of the specified elements
Examples
# load dataset
data("brachios")
# define ranks in dataset
b_ranks <- c("phylum", "class", "order", "family", "genus")
# plot taxon
plot_taxa(brachios, "Atrypa", trank = "genus", ranks = b_ranks, mode = "parent")