以下のこのスクリプトは、巨大なデータ セットを含むクラスターを取得するために適切に実行されますが、R から他の編集プログラムにエクスポートできるように、クラスターを newick ファイルまたはテキスト ファイルに取得する必要がありますが、方法が見つかりません。 hclust を newick 形式に変換するにはどうすればよいですか? 私は new2phylo 関数が仕事をするかもしれないと感じていますが、私たちはそれをうまく機能させることができませんでした.
あらゆる場所を検索しましたが、解決策が見つからないため、ご協力をお願いいたします =(
datos <- read.table("morphclustersred.csv",header=T,sep="\t")
head(datos)
distfunc <- function(x) daisy(x,metric="gower")
d <- distfunc(datos)
hclustfunc <- function(x) hclust(x, method="complete")
fit <- hclustfunc(d)
plot(fit)
plot(fit, labels=datos$Species,main='Morphological Clustering')
rect.hclust(fit, k=5, border="red")