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

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


My apologies.

I should have searched the bugs first. This was addressed here:

http://r-bugs.biostat.ku.dk/cgi-bin/R/Accuracy-fixed?id=5406;expression=eigen;user=guest

Apparently the problem has been fixed for 1.8.1-patched.

Thanks,
Sundar


Sundar Dorai-Raj wrote:
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list