I have a large document-Term matrix.
I want to combine columns which with the same column name.
I have found someone asked the same problem and had work solution. Combine columns in matrix having same column name
I have tried using the answer to do.
But R returns an error message to me.
Error: cannot allocate vector of size 49.3 Gb
#my large matrix
tf_mat <- as.matrix(dtm_title) %>%
cbind(as.matrix(dtm_abstract)) %>%
cbind(as.matrix(dtm_claim))
#Combine columns with same column name.
nms <- colnames(tf_mat)
tf_mat %*% sapply(unique(nms),"==", nms)
Error: cannot allocate vector of size 49.3 Gb
Is there any way to solve it? Or is there any other solution?