[英]Sorting ggplot barplot x-axis in descending order (only one variable on the x-axis)
[英]Corrplot with only one variable on x axis
我有大約200個變量的數據集。 我想了解這些變量之一與所有其他變量之間的關系。 但是,當我使用corrplot()
,它為我提供了完整的相關矩陣,該矩陣的大小為200x200
,並且可以很好地可視化。
對於可重現的示例,我將使用iris
數據集。 說,在這里,我只想在x軸上看到sepal.length
,在y軸上看到所有其他變量vs sepal.length
。
library(corrplot)
corrplot(cor(iris[,1:4]))
創建此:
但是我只想要這樣:
您可以僅選擇矩陣的第一列並取消顯示顏色標簽:
corrplot(cor(iris[,1:4])[1:4,1, drop=FALSE], cl.pos='n')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.