[R] La.eigen hangs R when NaN/NA is present

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Mon Dec 22 16:11:22 CET 2003


Hi all,
I discovered this problem when trying to use princomp in package:mva 
when a column (and row) in my matrix was all zeros and I set cor = TRUE, 
thus division by 0. Doing so hangs R, never to return. I have to shut 
down Rterm in the Task Manager and lose all work from the current image. 
I tracked down the problem to using La.eigen when the input matrix has 
one or more NaN/NA. Note that eigen(x, sym = TRUE) gives a sensible 
result without hanging R.

I have submitted a bug report.

 > version
          _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    1
minor    8.1
year     2003
month    11
day      21
language R
 >
 > x <- matrix(c(1, 1, 1, 0.5), 2, 2)
 > is.na(x[1, 1]) <- TRUE
 > x
      [,1] [,2]
[1,]   NA  1.0
[2,]    1  0.5
 > eigen(x, sym = TRUE)
$values
[1] NA NA

$vectors
[1] NA NA NA NA
 > La.eigen(x, sym = TRUE)
La.eigen(x, sym = TRUE)

# KILL R IN THE TASK MANAGER
Process R exited abnormally with code 1 at Mon Dec 22 08:57:51 2003




More information about the R-help mailing list