I am trying to plot the correlation between dependent variables of two time series.
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
...
...
I am using 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)
Getting error:
Error in corrplot(cor(foo$col1, foo1$col2), type = "upper", order = "hclust", : Need a matrix or data frame!
I see only two values in 'z'. How can I convert this from vector form to matrix form?