我试图绘制两个时间序列的因变量之间的相关性。使用R绘制两个时间序列数据之间的相关性
Data 1
======
1 3.1
2 3.3
3 3.1
4 4.5
...
...
Data 2
========
1 3.1
2 0.3
3 4.1
4 3.2
...
...
我使用R.
library(corrplot)
foo <- read.table("D:\\datas\\res\\A.txt", header=T,sep=",")
attach(foo)
foo1 <- read.table("D:\\datas\\res\\M.txt", header=T,sep=",")
attach(foo1)
res<-cor(foo$col1, foo1$col2)
corrplot(res, type="upper", order="hclust", tl.col="black", tl.srt=45)
获取错误 错误corrplot(COR(FOO $ COL1,foo1 $ COL2),类型= “上”,为了= “hclust”: 需要一个矩阵或数据帧!
我看到在“Z”只有两个值。我如何转换这种从载体形式的矩阵形式?