2017-05-03 8 views
1

を、次のコードここ順序付けられた相関行列から順リストを抽出します。私は相関行列を作成R

temp<-matrix(rexp(25, rate=.1), ncol=5) 
tempCor<-cor(temp) 
tempCor <- data.frame(tempCor) 
names(tempCor) <- c(1:5) 
corrplot(t(tempCor),method="pie",order="AOE") 

corrplot関数を使用して視覚化するcorrplot funcitonの結果である

plot

(4,5,1,3,2)というこの結果から注文リストを取得する方法はありますか?

+0

この 'corrMatOrder'ための機能があります。したがって、 'corrMatOrder(t(tempCor)、order =" AOE ")' – user20650

答えて

0

はこれを試してみてください:ここで

library(corrplot) 
set.seed(1234) 
temp <- matrix(rexp(25, rate=.1), ncol=5) 
tempCor <- cor(temp) 
tempCor <- data.frame(tempCor) 
names(tempCor) <- c(1:5) 
out <- corrplot(t(tempCor),method="pie",order="AOE") 
dimnames(out) 

は、あなたが探しているものです。

[[1]] 
[1] "5" "1" "3" "4" "2" 

[[2]] 
[1] "1" "2" "3" "4" "5" 
関連する問題