Created attachment 1739 [details]
Short R program which provokes the error
cbind(a,b) where a and b are long vectors fails with the message
Error in cbind(a, b) : long vectors not supported yet: bind.c:1311
I believe the patch is fairly simple:
In cbind() in src/main/bind.c, the int i,j,k,idx should be declared as R_xlen_t instead of int. The macro calls LENGTH(u) should be replaced with XLENGTH(u).
By the way, the loops doing the actual copying computes i % k for each element. Integer remainder is a very costly cpu operation, rewriting the loops to avoid this would most probably result in cbind being much faster.
That's not a very accurate description. cbind (and rbind) do support long vectors as outputs, and long vectors are not allowed as inputs because of the restriction on dimensions of an array. What they did not support (but could have) was input matrices with 2^31 or more elements but dimensions less than that. That has been added for R 3.2.0 (and care is needed as some of those variables are dimensions not lengths).