I am trying to reshape a (very) long table into a wide (very sparse) table.
The dimensions:
dim(data)
[1] 16146436 3
If i attempt the standard dcast
operation it fails due to running out of memory:
datac <- dcast(formula=gene ~ sample, value.var="Coverage", data=data)
Error: cannot allocate vector of size 23399.6 Gb
Any suggestions on either making dcast
run or alternatives that are optimized for large very sparse datasets?