简体   繁体   中英

untangle error labels do not match in both trees

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?

Any chance the labels are numeric in one of the two trees? Try running labels_to_character on both trees in the dendlist and see if that works. If so - please let us know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM