bwlewis / irlba

Fast truncated singular value decompositions
127 stars 17 forks source link

prcomp_irlba code has a bug in dealing with scaling #25

Closed Xiaojieqiu closed 6 years ago

Xiaojieqiu commented 7 years ago

when you set scale. = TRUE in the prcomp_irlba function, it will throw an error

> prcomp_irlba(exprs(HSMM), scale. = T)
Error in if (tol * ans$d[1] < eps) warning("convergence criterion below machine epsilon") : 
  missing value where TRUE/FALSE needed

I think the error comes from the variable center in line 94 of the prcomp.R file, it should be args$center instead of center because center is a logic value by default.

bwlewis commented 7 years ago

Shoot, sorry about this newly introduced bug. Working on this today, will have a fix on GitHub tonight. I'll plan for a bug fix release to CRAN by the end of the week or so.

temporary work-around: supply an explicit scaling vector instead of TRUE/FALSE

bwlewis commented 7 years ago

Try the GitHub master branch now. I have a few other issues to fix and then will submit to CRAN again.

bwlewis commented 6 years ago

This should be fixed on CRAN version 2.3.2, please re-open if you still have troubles.