I am working on MoveLens dataset. Everytime I try to use the reshape2 or tidyr it crashes my macbook pro. I wonder if it's because of the storage or the system.
It works fine when I only use the head of the dataset, the dataset has total of 2 million obs.
head(ratings)
userID movieId rating timestamp
1 1 2 3.5 1112486027
2 1 29 3.5 1112484676
3 1 32 3.5 1112484819
4 1 47 3.5 1112484727
5 1 50 3.5 1112484580
6 1 112 3.5 1094785740
rat_mat <- dcast(ratings,userId~movieId, value.var="rating",na.rm=FLASE)
#Create ratings matrix. Rows = userId, Columns = movieId
require(tidyr)
rat_mat<- spread(ratings,userId,rating)
Error Message:
"NAs introduced by coercion to integer range
Show Traceback
Error in dim.data.table(x) : long vectors not supported yet: ../../../../R-3.4.1/src/include/Rinlinedfuns.h:138"