自分が書いたRコードに問題があります。特にそれはこのように見えます:
n<- nrow(aa)
for (i in 1:n)
{
A<- aa[i,]
d_ply(A, 1, function(row){
cu<- dist(A)
write.table(cu, file = paste(row$header, "txt", sep = "."), sep = "\t")
}, .progress='text', .print = TRUE)
}
行列の各行から単一のファイルを取得したいのですが(ファイル名は行のヘッダーである必要があります)、その行の距離行列が含まれていますが、非常に難しいようです。コードを試してみると、次のエラーが発生します。
cannot coerce class '"dist"' into a data.frame
どうすればこれを解決できますか?