Monday, August 18, 2014

drop.tip methods for contMap & densityMap now in phytools

The functions drop.tip.contMap and drop.tip.densityMap (described here for drop.tip.contMap) are now in phytools 0.4-30 which can be downloaded and installed from source.

Here's how they work:

## install & load phytools
install.packages("phytools_0.4-30.tar.gz",type="source")
## Installing package into 'C:/Users/Liam/Documents/R/win-library/3.1'
## (as 'lib' is unspecified)
## inferring 'repos = NULL' from the file name
library(phytools)
packageVersion("phytools")
## [1] '0.4.30'
## simulate tree & data
tree<-pbtree(n=26,tip.label=LETTERS[26:1],scale=1)
x<-fastBM(tree)
## create "contMap" obj
obj<-contMap(tree,x,plot=FALSE)
## drop tips
tips<-sample(LETTERS,10)
tips
##  [1] "L" "K" "N" "E" "G" "P" "J" "V" "M" "S"
obj<-drop.tip.contMap(obj,tips)
## plot
plot(obj)

plot of chunk unnamed-chunk-1

That's it.

No comments:

Post a Comment

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.