2011-05-14 95 views
3

我想製作彩色樹狀圖,但還沒有找到足夠的庫:http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=79 此圖形/庫看起來很有前途,但無法安裝A2E庫? 試圖在Windows上安裝,下載了tar.gz文件,無法從R控制檯安裝軟件包。R彩色樹狀圖建議?

另外:

Warning messages: 
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file 
2: In gzfile(file, "r") : 
    cannot open compressed file 'A2R_0.0-4.tar.gz/DESCRIPTION', probable reason 'No such file or directory' 

任何人都可以看看他們是否能得到這個A2R庫工作,確認錯誤,或提出一個很好色的樹狀庫?

+1

以下是一段關於着色樹狀圖的帖子:http://stackoverflow.com/questions/4720307/change-dendrogram-leafs-in-r – 2011-05-15 08:22:10

回答

4

(如果拼寫正確,這可能會有幫助。)A2R是一個源代碼包。所以你可能需要有用於編譯的系統工具鏈。如果您使用的是Linux系統,那麼這些通常位於您的系統中,但如果您使用的是Mac系統(如我)或Windows系統,則不會。該軟件包可以在Mac上從源代碼進行編譯。編譯過程可能不需要工具鏈。所以,試試這個:

install.packages("<fullpath> A2R_0.0-4.tar.gz", type ="source") 

還有一些其他的依賴: 'trimcluster', 'prabclus', '大衆', '集羣', 'mclust', 'flexmix', 'modeltools', 'stats4', 'multcomp','mvtnorm'。我能夠獲得大部分的圖形,但如圖所示,左側曲線不出現,我沒有得到一個錯誤:

 Error in hubertgamma[i] <- cluster.stats(d.usa, cutree(h.usa, k = i + : 
    replacement has length zero: 

This is the example plot

如果你不想樹狀圖的高度調整爲它們的深度可以此修改添加到hclust對象:

h.usa$height <- log(h.usa$height) 
+0

thx是的,我需要type =「source」> install.packages (「C:/Revolution/R-Enterprise-4.3/A2R_0.0-4.tar.gz」,type =「source」) 從文件名中推斷'repos = NULL' – user291071 2011-05-14 19:43:24

+0

你提到你以前用過這個,我現在正在工作,但我試圖弄清楚如何改變分支的長度或深度,因爲我有一個更大的數據集,並且我發現樹狀圖分支的最後一層幾乎沒有高度。我想到如何添加更多的顏色等已經。任何提示讚賞 – user291071 2011-05-14 23:19:14

+0

聽起來像你有一個新的問題。 – 2011-05-15 05:22:36

1

你可以在使用dendrapply()函數R的內置樹狀圖碼應用自定義葉節點着色。有關提示,請參閱following mailing list thread