Permalink
Browse files

new option in plotTree.barplot

  • Loading branch information...
liamrevell committed Oct 18, 2017
1 parent e984799 commit 1007197a5f9ae0ce3671be7457a38e185ac36cb4
Showing with 11 additions and 9 deletions.
  1. +4 −4 DESCRIPTION
  2. +4 −2 R/plotTree.wBars.R
  3. +3 −3 man/plotTree.wBars.Rd
View
@@ -1,6 +1,6 @@
Package: phytools
Version: 0.6-30
Date: 2017-10-03
Version: 0.6-31
Date: 2017-10-18
Title: Phylogenetic Tools for Comparative Biology (and Other Things)
Author: Liam J. Revell
Maintainer: Liam J. Revell <liam.revell@umb.edu>
@@ -56,6 +56,6 @@ Description: Package contains various functions for phylogenetic analysis.
research.
License: GPL (>= 2)
URL: http://github.com/liamrevell/phytools
Packaged: 2017-10-03 12:00:00 EST
Packaged: 2017-10-18 12:00:00 EST
Repository:
Date/Publication: 2017-10-03 12:00:00 EST
Date/Publication: 2017-10-18 12:00:00 EST
View
@@ -52,7 +52,9 @@ plotTree.boxplot<-function(tree,x,args.plotTree=list(),
## written by Liam J. Revell 2016, 2017
plotTree.barplot<-function(tree,x,args.plotTree=list(),
args.barplot=list()){
args.barplot=list(), ...){
if(hasArg(add)) add<-list(...)$add
else add<-FALSE
cw<-reorder(tree)
if(is.data.frame(x)) x<-as.matrix(x)
if(is.matrix(x)){
@@ -87,7 +89,7 @@ plotTree.barplot<-function(tree,x,args.plotTree=list(),
args.plotTree$mar[3]<-args.barplot$mar[3]
if(is.null(args.plotTree$ftype)) args.plotTree$ftype<-"i"
if(is.null(args.plotTree$lwd)) args.plotTree$lwd<-1
par(mfrow=c(1,2))
if(!add) par(mfrow=c(1,2))
do.call(plotTree,args.plotTree)
par(mar=args.barplot$mar)
obj<-do.call(barplot,args.barplot)
View
@@ -7,8 +7,8 @@
plotTree.wBars(tree, x, scale=1, width=NULL, type="phylogram",
method="plotTree", tip.labels=FALSE, col="grey", border=NULL,
...)
plotTree.barplot(tree,x,args.plotTree=list(),args.barplot=list())
plotTree.boxplot(tree,x,args.plotTree=list(),args.boxplot=list())
plotTree.barplot(tree, x, args.plotTree=list(), args.barplot=list(), ...)
plotTree.boxplot(tree, x, args.plotTree=list(), args.boxplot=list())
}
\arguments{
\item{tree}{an object of class \code{"phylo"}.}
@@ -23,7 +23,7 @@ plotTree.boxplot(tree,x,args.plotTree=list(),args.boxplot=list())
\item{args.plotTree}{in \code{plotTree.barplot}, arguments to be passed to \code{\link{plotTree}}.}
\item{args.barplot}{in \code{plotTree.barplot}, arguments to be passed to \code{\link{barplot}}.}
\item{args.boxplot}{in \code{plotTree.boxplot}, arguments to be passed to \code{\link{boxplot}}.}
\item{...}{optional arguments to be passed to \code{\link{plotTree}} or \code{\link{plotSimmap}}.}
\item{...}{optional arguments to be passed to \code{\link{plotTree}} or \code{\link{plotSimmap}} in the case of \code{plotTree.wBars}. For \code{plotTree.barplot}, the only optional argument is \code{add}. Generally this should not be used; however it can be used to tell the function to draw the tree & barplot, respectively, in the next two open plotting devices - rather than creating a table of figures in the current plotting device.}
}
\description{
\code{plotTree.wbars} plots a phylogeny in phylogram or fan style with bars at the tips representing the values for a phenotypic trait.

0 comments on commit 1007197

Please sign in to comment.