**0**wrote:

Greetings,

I was attempting to use HOPACH to cluster the rows of a 610758 x 9 matrix of floating points, but the distancematrix function gave the following error:

Error in .Call("R_disscosangle", as.vector(X), as.numeric(dim(X)[1]), : negative length vectors are not allowed

I can recreate the error as follows (session info included):

> library("hopach") > test <- matrix(runif(1000*10), 1000, 10) > my.dist <- distancematrix(test, "cosangle") # works > dim(my.dist) [1] 1000 1000 > test <- matrix(runif(610758*9), 610758, 9) > my.dist <- distancematrix(test, "cosangle") # error message shows up immediately Error in .Call("R_disscosangle", as.vector(X), as.numeric(dim(X)[1]), : negative length vectors are not allowed > sessionInfo() R version 3.1.2 (2014-10-31) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] C attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] hopach_2.26.0 Biobase_2.26.0 BiocGenerics_0.12.1 [4] cluster_2.0.1 > test <- matrix(runif(100000*10), 100000, 10) > my.dist <- distancematrix(test, "cosangle") # after a while we get a segfault *** caught segfault *** address 0x7f60e326b000, cause 'invalid permissions' Traceback: 1: .Call("R_disscosangle", as.vector(X), as.numeric(dim(X)[1]), as.numeric(dim(X)[2]), as.logical(na.rm)) 2: disscosangle(X, na.rm) 3: distancematrix(test, "cosangle")

Am I running out of memory? (https://www.google.com/webhp?q=negative+length+vectors+are+not+allowed+r)

Cheers,

Eric