R 中的 Corrplot 不起作用

Corrplot in R not working

我正在尝试使用 corrplot 计算出这三个标签之间的相关性:

train.Item_ID   train.Price   train.Number_Of_Sales
30495           165.123          1
30375           68.666           5
30011           253.314          2
30864           223.122          1
30780           28.75            1

但不知何故,它没有显示不同标签之间的互相关性。

corrplot(cor(newtrain),method = "number")

基本上它只显示 1,1,1 但没有互相关,然后尺寸变小了。请提出建议。

看来你的数据有点乱。我收到了你的数据,一切正常:

library(corrplot)

d <- "train.Item_ID   train.Price   train.Number_Of_Sales
1 30495           165.123          1
2 30375           68.666           5
3 30011           253.314          2
4 30864           223.122          1
5 30780           28.75            1"

d <- read.table(text = d, header = T)

corrplot(cor(d), method = "number")