我正在運行帶有varimax旋轉的主成分分析,並希望顯示看似簡單的情節,但是我的加載向量在某些地方非常接近,而且它們傾向於哪些因素的標籤傾向於重疊。這是ggrepel進來分離標籤的地方。我現在的困境是弄清楚如何連接兩者。我使用了自動添加所需文本的自動繪圖,並且很難定義要排斥哪些文本。可能還有其他方法可以解決這個問題,我願意提出建議。我有我的代碼,但有重疊和我的企圖排斥下面的代碼之一。使用ggfortify和ggrepel進行pca
autoplot(prcomp(built.df9),
loadings = TRUE, loadings.colour = 'blue', loadings.label = TRUE,
loadings.label.size = 4, loading.label.color = 'red') +
ggtitle(label = "Principal Component Analysis and Varimax Rotation for Built
Environment Indicators") +
geom_text_repel(aes(label = rownames(prcomp(built.df9))))
autoplot(prcomp(built.df9),
loadings = TRUE, loadings.colour = 'blue', loadings.label = TRUE,
loadings.label.size = 4, loading.label.color = 'red') +
ggtitle(label = "Principal Component Analysis and Varimax Rotation for Built
Environment Indicators")
非常感謝您J.康尼馬上解決了我的問題! –