I have two dendrograms that I'm trying to calculate the entanglement of as follows:
dend12 <- dendlist(dend1, dend2)
x <- dend12 %>% untangle(method = "step2side")
These dendrograms are valid binary trees.
I'm getting the error message:
Error in match_order_by_labels(dend2, dend1) : labels do not match in both trees. Please make sure to fix the labels names! (make sure also that the labels of BOTH trees are 'character')
I checked that the labels of both trees are type 'character' what I don't understand is that when I do:
sort(labels(dend1)) == sort(labels(dend2))
I get a vector of all Trues, indicating that the labels are the same, so I don't understand where my error is originating from.
Can someone please explain what "labels do not match in both trees" exactly means from the error that is preventing me from performing the untangle function?