[R] chisq.test freezing on certain inputs

Jeffrey Chang jeffrey.chang at duke.edu
Thu Dec 11 15:58:43 CET 2003


Hello everybody,

I'm running R 1.8.1 on both Linux and OS X compiled with gcc 3.2.2 and 
3.3, respectively.  The following call seems to freeze the interpreter 
on both systems:
 > chisq.test(matrix(c(233, 580104, 3776, 5786104), 2, 2), 
simulate.p.value=TRUE)

By freeze, I mean, the function call never returns (running > 10 hours 
so far), the process is unresponsive to SIGINT (but I call kill it with 
TERM), and the process still consumes cycles on the CPU.

Browsing through the code, it seems to be getting stuck on the C call 
to "chisqsim" .

Browse[1]>
debug: tmp <- .C("chisqsim", as.integer(nr), as.integer(nc), 
as.integer(sr),
     as.integer(sc), as.integer(n), as.integer(B), as.double(E),
     integer(nr * nc), double(n + 1), integer(nc), results = double(B),
     PACKAGE = "ctest")
Browse[1]>

Has anyone seen this, or know what may be causing it?

Thanks,
Jeff




More information about the R-help mailing list