Tanglegram上的标签不起作用(dendextend)

问题描述 投票:0回答:1

我曾多次尝试将标签放在tanglegram(包dendextend)上,但我的标签(etic)不起作用,它们也适用于简单的情节。我应该使用哪个命令?

> dati<-read.table("moto.txt",header=T)
> dat<-dati[,-1:-3] #I delete the first three columns because they are 
    qualitative variables (motorcycle brand and model)
> etic<-read.table("moto.txt",header=T)[,2] #my labels (motorcycle model)
> etic
[1] R1200GS AfricaT V-Strom Scrambl MT-07   Z650    Tracer  Multist CB500X  
    Iron883 CMX500  Vulcan  Supers  CBR-RR  GSX-R  
> sdx<-scale(dat)
> d<-dist(sdx)#I assign the matrix of distances to "d"
> library (dendextend)
> hc1<-hclust(d,method="complete")
> hs1<-hclust(d,method="single")
> tanglegram(hc1,hs1, labels=etic)
Error in axis(side = side, at = at, labels = labels, ...) : 
 'labels' is supplied and not 'at'
  Inoltre: Warning messages:
  1: In plot.window(...) : parametro grafico "labels" non valido
  2: In plot.xy(xy, type, ...) : parametro grafico "labels" non valido

> tanglegram(hc1,hs1) #tanglegram work but without labels
r labels dendextend
1个回答
0
投票

函数中没有称为“标签”的参数。您应该更新树形图的标签并将其提供给tanglegram。

© www.soinside.com 2019 - 2024. All rights reserved.