Need help with exporting a phylogenetic tree

Hey everyone! So I have a phylogenetic tree that needed some editing. I removed some tips with the command drop.tip from the treeio package. Then I changed the labels of the tips by making a dataframe of the new label names and then inserting them into the tree like so:

newlabels<- c("C. eucineta", "C. codringtonii", "C. elisabethae","C. gittenbergeri", "C. helenae", "C. intusplicata", "C. parnassia")
tree$tip.label<- newlabels

From that point on, I need to export the tree. I tried to do so by using the write.beast command (since the tree contains data regarding the time of the divergence) but I got the following message:

Error in (function (cl, name, valueClass) :
‘phylo’ is not a slot in class “phylo”

If anyone has a clue I'd appreciate it!

I don't think that I can help because I don't know anything about phylogenetic trees.
But members of this forum that do know, probably need to know the packages that you use.
I think it would also help them if you included more (all?) of the code you use.

At which point in your workflow you can no longer use write.beast to export the tree?
If the error also occurs for your original tree then you obviously can't use write.beast and your tree object is not of class phylo. Otherwise check in each stage if write.beast still works. If not then the last manipulation was not correct: you used an operation that is valid R but changed the class of the object.

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.