Question

I am using R. I want to run prcomp on a matrix. The code works fine with one installation of R on a Linux box but breaks on another identical (or so I thought) installation of R on a different Linux box. The codes are

dataf = read.table("~/data/testdata.txt")
pca = prcomp(dataf)

The error msg on the bad instance is

> dataf = read.table("~/data/testdata.txt")
> pca = prcomp(dataf)
Error in La.svd(x, nu, nv) :
  BLAS/LAPACK routine 'DGESDD' gave error code -12

Both instances of R has R version 2.9.2 (2009-08-24) and, as far as I can tell, all the R libraries and environmental variables are configured in identical ways as well.

So does anyone have suggestions on what might be wrong? What does that error code mean? (I searched internet and found nothing helpful...) Thanks a lot in advance!

Was it helpful?

Solution

Your second box may have a broken Blas / Lapack installation. Unfortunately we cannot tell as you problem is not reproducible.

Here is another simple call to Blas / Lapack -- does this work for you?

R> crossprod(matrix(1:4, ncol=2))
     [,1] [,2]
[1,]    5   11
[2,]   11   25
R> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top