r - Error message while converting 2.1 mil rows from long to wide format -
i have been battling code day trying convert data long wide format. let me explain data set , code used. i have on 2 million rows 700k unique subject(usb), 125 unique days(date, m-d-y format), 83 unique group (grp), kyc , val1. here last code looks based on solution found on stackoverflow: n1 = unique(mydata[,c("usb","date")]) n1$idv = 1:nrow(n1) n2=merge(mydata,n1) dcast(n2,usb + idv ~ grp, value.var="val1"). this worked small portion of data other failed whole data set. i noticed unique(mydata[,c("usb","date","kyc")]) works better small sample , genesis of problem. for privacy reason can not post portion of data. please appreciate suggestion or how fix this. below other examples here have tried no luck library(splitstackshape) out_df <- dcast( getanid( x_df, 'time' ), time~.id, value.var='measure' ) qcc( out_df[,-1], type = 'xbar', labels = out_df[,1] ) i tried : ...