I have a correlation matrix in R for >25000 variables. The problem is, that I can't do anything with it because of the huge amount of needed memory. What I don't understand why I can't even to very primitive stuff like modifing single entries. E.g.
> cors = cor(my.data)
> class(cors)
[1] "matrix"
> dim(cors)
[1] 26267 26267
> cors[1,1] = 1
Error: cannot allocate vector of size 5.1 Gb
Why should R need that much memory to change one value...? I get the same errors when I try stuff like diag(cors)
or upper.tri(cors)
...I know that sparse matrices might offer a solution but when I try to convert it i get the same error....
> m = Matrix(cors, sparse=T)
Error: cannot allocate vector of size 5.1 Gb
Why is it so difficult even when I want to modify a single value only?