0

タングルグラム (パッケージ 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
4

1 に答える 1