This is an extension to an existing question: Convert table into matrix by column names
I am using the final answer: https://stackoverflow.com/a/2133898/1287275
The original CSV file matrix has about 1.5M rows with three columns ... row index, column index, and a value. All numbers are long integers. The underlying matrix is a sparse matrix about 220K x 220K in size with an average of about 7 values per row.
The original read.table works just fine.
x <- read.table("/users/wallace/Hadoop_Local/reference/DiscoveryData6Mo.csv", header=TRUE);
My problem comes when I do the reshape command.
reshape(x, idvar="page_id", timevar="reco", direction="wide")
The CPU hits 100% and there it sits forever. The machine (a mac) has more memory than R is using. I don't see why it should take so long to construct a sparse matrix.
I am using the default matrix package. I haven't installed anything extra. I just downloaded R a few days ago, so I should have the latest version.
Suggestions?
Thanks, Wallace