I dug into the code and apparently when constructing the output matrix the dimensions are converted to integer:
count <- as.integer(round(choose(n, m)))
out <- matrix(r, nrow = len.r, ncol = count) # matrix for now
Eliminating the as.integer
from count
increases its range and in my case it doesn't overflow anymore.
It wasn't enough though, I continue to receive the same error again.
I couldn't find a way to initialize the matrix as type integer, so I created two vectors instead (m=2)like that:
col1 <- vector(mode="integer", length=n)
col2 <- vector(mode="integer", length=n)
With few more adjustments it runs now.
I hope this might help to others as well.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…