Получить имена каждого узла в дендрограмме - PullRequest
0 голосов
/ 08 февраля 2019

Я создал дендрограмму, используя dendextend и data.tree.Я могу получить координаты каждого узла, используя get_nodes_xy(), но в идеале я бы также хотел вернуть имена, которые я назначил в моем исходном наборе данных, а не просто идентификатор.Это возможно?

ExampleData:

#Indo-European;Italic;Romance;Italo-Western;Western Italo-Western;Gallo-Iberian;Gallo-Romance;Gallo-Italian;Romagnol
#Indo-European;Italic;Romance;Italo-Western;Western Italo-Western;Gallo-Iberian;Gallo-Romance;Gallo-Italian;Venetian
#Indo-European;Italic;Romance;Italo-Western;Western Italo-Western;Gallo-Iberian;Gallo-Romance;Gallo-Rhaetian;Oil;French;French
#Indo-European;Italic;Romance;Italo-Western;Western Italo-Western;Gallo-Iberian;Gallo-Romance;Gallo-Rhaetian;Oil;French;Cajun French

Код

library(dendextend)
library(data.tree)
ExceptII <- read.csv("ExampleData.csv", sep=";",header=TRUE, stringsAsFactors = FALSE)
ExceptII$pathString <- paste("ExceptII",ExceptII$Level1,ExceptII$Level2,ExceptII$Level3,ExceptII$Level4,ExceptII$Level5,ExceptII$Level6,ExceptII$Level7,ExceptII$Level8,ExceptII$Level9,ExceptII$Level10,ExceptII$Level11, sep= "|")
ExceptIITree <- as.Node(ExceptII, pathDelimiter = "|")
ExceptIITree
dendroIE <- as.dendrogram(ExceptIITree)
plot(dendroIE, center=TRUE)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...