I have two phylogenetic trees (extension .nex) and need to plot them face to face with links between them.
I have also done a .cvs file with the associations between these two trees.
However, when I try ro run the commands that I have found I got some error message:
tree.nex <- rtree(40) parasitetree.nex <- rtree(20)
creation of the association matrix:
association <- read.csv("assoc.csv") cophyloplot(tree.nex, parasitetree.nex, assoc = association, length.line = 4, space = 28, gap = 3)
then I get this error:
Error: $ operator is invalid for atomic vectors
If I try with:
trees<-read.tree("Tree.nex") tree.nex<-trees[] parasitetree.nex<-trees[] assoc<-read.csv("assoc.csv") obj<-cophylo(tree.nex,parasitetree.nex,assoc=assoc, print=TRUE)
Error in cophylo(tree.nex, parasitetree.nex, assoc = assoc, print = TRUE) : tr1 & tr2 should be objects of class "phylo".
Any help is more than welcome :)