Re: [R-sig-phylo] Using bind.tree on simmaps

2016-05-19 Thread Liam J. Revell

Hi Christie.

Unfortunately, there is no such function; however I just wrote a simple 
wrapper for bind.tree that does this for the simplest case of binding to 
trees together at a node. I posted the code to my blog here: 
http://blog.phytools.org/2016/05/bindtree-for-objects-of-class-simmap.html. 
Let us know if it seems to work (or, conversely, if you encounter issues).


All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: [email protected]
blog: http://blog.phytools.org

On 5/18/2016 1:35 PM, Christie Ziegler wrote:

Is it possible to bind two simmaps together? When I attempt to run the
following code, the call to bind.tree doesn't throw any errors but I get an
error when I attempt to plot the resulting tree:


library(ape)
library(phytools)


t1 <- pbtree(n=100, scale=5)
t2 <- pbtree(n=100, scale=5)

Q1 <- matrix(c(-0.1,0.1,0.1,-0.1), 2,2)
Q2 <- matrix(c(-1,1,1,-1), 2,2)

s1 <- sim.history(t1, Q1)
s2 <- sim.history(t2, Q2)

out <- bind.tree(s1, s2)

plot(out)

Error in tree$mapped.edge[ii, ] : subscript out of bounds


Thanks,

- Christie Ziegler

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/



___
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/


[R-sig-phylo] Using bind.tree on simmaps

2016-05-18 Thread Christie Ziegler
Is it possible to bind two simmaps together? When I attempt to run the
following code, the call to bind.tree doesn't throw any errors but I get an
error when I attempt to plot the resulting tree:


library(ape)
library(phytools)


t1 <- pbtree(n=100, scale=5)
t2 <- pbtree(n=100, scale=5)

Q1 <- matrix(c(-0.1,0.1,0.1,-0.1), 2,2)
Q2 <- matrix(c(-1,1,1,-1), 2,2)

s1 <- sim.history(t1, Q1)
s2 <- sim.history(t2, Q2)

out <- bind.tree(s1, s2)

plot(out)
> Error in tree$mapped.edge[ii, ] : subscript out of bounds

Thanks,

- Christie Ziegler

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - [email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/[email protected]/