Sunday, August 10, 2014

Bug fix in read.simmap

A colleague reported the following bug in read.simmap:



## [1] '0.4.28'



## Error: object 'trans' not found

Evidently, I introduced this error at some point by setting trans (the translation table) to be NULL when the tree format was "phylip", rather than "nexus", within a logical statement that first checks if the tree is to be read from file. Oops.

Fortunately this bug is pretty easy to fix. I have posted the updated code here, but users will probably have to install a new version of phytools since read.simmap uses various phytools internals that are not in the read.simmap.R source file.

Let's try it:



## Installing package into 'C:/Users/Liam/Documents/R/win-library/3.1'

## (as 'lib' is unspecified)

## inferring 'repos = NULL' from the file name






## Phylogenetic tree with 4 tips and 3 internal nodes.


## Tip labels:

## [1] "A" "B" "C" "D"


## Rooted; includes branch lengths.


plot of chunk unnamed-chunk-2

That's it.

BTW, for the first time I am today attempting to create my blog posts using knit2html in the knitr package. I already use this package for creating tutorials for my various R phylogenetic classes & workshops, but this is the first time trying it out on the blog.

No comments:

Post a Comment

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