我尝试了几次将标签放在 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