I am trying to root my phylogenetic tree in R using the ape package root function. First, reading in the tree and making it class phylo,
pomptree<-"Pomptrees"
PompTree<-ape::read.nexus(pomptree)
Then creating my outgroup,
Outgroup<-c("Brachycistis_alcanor_U51B22","Brachycistis_curvata_U72B92","Brachycistis_petiolata_U68B68",
"Dasymutilla_blattoserica_U88JP841","Dasymutilla_creon_U87JP670","Dasymutilla_monticola_U85JP371","Dasymutilla_quadrigutatta_U83JP313",
"Invreiella_cephalargia_PS113")
Then using the following code to root the tree with this outgroup designated.
PompTreeRoot<-root(PompTree,Outgroup,resolve.root = TRUE, edgelabel = TRUE)
But, I get the below error and sometimes R experiences a fatal error:
Error in x$edge[neworder, ] : invalid subscript type 'any'
There are plenty of examples with "invalid subscript type 'line' ", but I cannot find what the 'any' means. I think it is something in my treefile that R is not liking, because I also can't run the R package for bayestraites either without a fatal error and the below error message
Error in phy$edge.lenght[-terms] : only 0's may be mixed with negative subscripts
I get the meaning of this error, but have no clue how to address the issue, or where to even start. Any help would be appreciated, thank you!