I have a 6x6 correlation matrix that I want to import:
1.0000
0.6008 1.0000
0.4984 0.4749 1.0000
0.1920 0.2196 0.2079 1.0000
0.1959 0.1912 0.2010 0.4334 1.0000
0.3466 0.2979 0.2445 0.3197 0.4207 1.0000
I've tried using scan() directly, but it won't input the matrix.
A <- matrix(scan("data.txt", n = 6*6), 6, 6, byrow = TRUE)
This didn't work because "data length [21] is not a sub-multiple or multiple of the number of rows [6]".
What other methods can be used to import an external, pre-existing correlation matrix?