I have a correlation table with both positively and negatively correlated values:
cor.table <- matrix(rep(c(-0.1, 0.1), each=1250),50,50)
diag(cor.table) <- 1
I would like to create a covariance matrix from this using:
cov.mat<-cor2cov(cor.table,c(rep(20,50)))
However I get the following error:
Error in cor2cov(cor.table, c(rep(100, 50))) :
The object 'cor.mat' should be either a symmetric or a triangular matrix
How can I create a symmetric correlation matrix where values are either positively (0.1) or negatively (-0.1) correlated?