tax.arrows: Draw arrows next to phylogenetic taxa

View source: R/tax_arrows.R

tax.arrowsR Documentation

Draw arrows next to phylogenetic taxa

Description

By giving taxon numbers of a phylogenetic tree and graphical parameters, the function plots the phylogeny (if not already plotted) and arrows next to taxa for graphical purposes.

Usage

tax.arrows(phy,tax,side="topleft",angle=45,length,offset,arrow.fun="arrows",arrow.pars)

Arguments

phy

A phylogenetic tree.

tax

A vector with the name or the number of the taxa (tips and/or nodes) for plotting the arrows next to.

side

A vector to specify the side for plotting the arrows. Can be one 1 or "topleft" (the default), 2 or "topright", 3 or "bottomleft", or 4 or "bottomright".

angle

The angle of the arrow in degrees. Can be a value between 0 and 360, somewhat overriding the side parameter. Default set to 45.

length

The length of the arrow. Default is to one tenth of the x span, but the user may try several values since this length if then expressed using both x and y.

offset

The length of the distance between the taxon and the end of the arrow. Default is to one tenth of the length, but the user may try several values since this length if then expressed using both x and y.

arrow.fun

The function to be used to draw the arrows, keeping in mind that the system used is here by providing x0/x1/y0/y1 coordinates. Default to arrows, but the user may want to use the [shape::Arrows] function.

arrow.pars

A list of arguments to be passed to the arrow function used. See [base::arrows] for the base function arguments; see [shape::Arrows] for the function from the shape package.

Examples

require(ape)
set.seed(1)
phy<-rtree(20)
plot(phy)
tax<-c(2,7,32)
tax.arrows(phy,tax)
tax.arrows(phy,tax,angle=0)
tax.arrows(phy,tax,angle=90)
tax.arrows(phy,tax,angle=45,arrow.pars=list(length=0.1,angle=30))
require(shape)
tax.arrows(phy,tax,angle=45,arrow.pars=list(arr.length=0.5,arr.type="triangle"),arrow.fun="Arrows")
tax.arrows(phy,tax,angle=45,arrow.pars=list(arr.length=0.2,arr.type="triangle",arr.col="red"),arrow.fun="Arrows")


jacobmaugoust/ULT documentation built on May 16, 2023, 1:29 p.m.