plotShift generates customized functions to produce plots out of search.shift results. addShift adds circles to highlight shifting clades onto the currently plotted tree.
RR: the object produced by RRphylo used to perform search.shift.
SS: an object produced by search.shift.
mode: if search.shift was performed under status.type = "clade" by setting the node argument, mode is a numeric indicating whether the output number 1, that is ...$single.clades$singles or the output number 2 ...$single.clades$no.others should be plotted.
state: if search.shift was performed under status.type = "sparse", this is the same state vector provided to the function.
symbols.args: as described for $plotClades below.
Returns
The function returns a function to generate a customizable plot of search.shift results.
If search.shift was performed under status.type = "clade", plotShift returns a ‘plotClades’functionwhichhighlightstheshiftingcladesontothephylogenetictree.Theusageis:‘...plotClades(tree.args=NULL,symbols.args=NULL), where tree.argsis a list of further arguments passed to the functionplot.phylo, and symbols.argsis a list of further arguments passed to the functionsymbols(n.b. the shape of the symbol is not customizable). The function automatically plots red circles for negative shifts and blue circles for positive shifts, in each cases with the radium proportional to the absolute value of rate difference. The user can choose different color options for positive/negative shifts by settingsymbols.args=list(fg=c(pos="color for positive shift",neg="color fornegative shift"))`, or provide a vector of as many colors as the number of shifting clades. The same applies to the argument "bg".
If search.shift was performed under status.type = "sparse", plotShift returns a ‘plotStates’ function which plots the comparison between the real difference and the distributions of random differences (see c("[list(\"search.shift\")](../doc/search.shift.html)", "[ vignette#sparse](../doc/search.shift.html)")). The usage is: `...plotStates(plot.args=NULL,points.args=NULL,legend.args=list()), where plot.argsis a list of further arguments passed to the functionplot(used in the form:plot(y~x)), points.argsis a list of further arguments passed to the functionpoints, and legend.argsis a list of additional arguments passed to the functionlegend(if= NULLthe legend is not plotted). If as many colors/pch values as the number of different states are provided inpoints.args`, each of them is assigned to each states taken in the same alphabetical order.
Details
Using ...$plotClades() or plotting the tree and applying addShift() returns the same plot. The latter function might be useful in combination with plotRR to add the shifts information to the branch-wise plot of evolutionary rate values.
Castiglione, S., Tesone, G., Piccolo, M., Melchionna, M., Mondanaro, A., Serio, C., Di Febbraro, M., & Raia, P.(2018). A new method for testing evolutionary rate variation and shifts in phenotypic evolution. Methods in Ecology and Evolution, 9: 974-983.doi:10.1111/2041-210X.12954