Permalink
Browse files

update to formula method to plotTree.boxplot

  • Loading branch information...
liamrevell committed Jul 25, 2016
1 parent e2e994b commit a1ef0491b4533d531607a0f5bc5895d19d774ab2
Showing with 7 additions and 1 deletion.
  1. +6 −0 R/plotTree.wBars.R
  2. +1 −1 man/plotTree.wBars.Rd
View
@@ -31,6 +31,12 @@ plotTree.boxplot<-function(tree,x,args.plotTree=list(),
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))
ii<-which(names(args.boxplot)%in%c("formula","x"))
args.boxplot<-c(args.boxplot[ii],args.boxplot[-ii])
args.boxplot$plot<-FALSE
obj<-do.call(boxplot,args.boxplot)
args.boxplot$plot<-TRUE
args.plotTree$tips<-setNames(1:Ntip(cw),obj$names)
do.call(plotTree,args.plotTree)
par(mar=args.boxplot$mar)
ii<-which(names(args.boxplot)%in%c("formula","x"))
View
@@ -11,7 +11,7 @@ plotTree.boxplot<-function(tree,x,args.plotTree=list(),args.boxplot=list())
}
\arguments{
\item{tree}{an object of class \code{"phylo"}.}
\item{x}{a named vector of trait values. For \code{plotTree.boxplot}, the names should repeat for multiple observations per species. For \code{plotTree.boxplot} \code{x} can also be supplied as a formula, though in that case the factor levels need to be provided in the cladewise order of the tips in \code{tree}.}
\item{x}{a named vector of trait values. For \code{plotTree.boxplot}, the names should repeat for multiple observations per species. For \code{plotTree.boxplot} \code{x} can also be supplied as a formula, though in that case the factor levels need to be provided in a valid cladewise order of the tips in \code{tree}. This order doesn't need to correspond with the current order of the tip labels.}
\item{scale}{scaling factor for the tip bars (relative to the total tree height).}
\item{width}{width of the tip bars.}
\item{type}{plot type. Can be \code{"phylogram"} or \code{"fan"}.}

0 comments on commit a1ef049

Please sign in to comment.