stephenslab / susieR

R package for "sum of single effects" regression.
https://stephenslab.github.io/susieR
Other
169 stars 42 forks source link

res$alpha[i, ] : subscript out of bounds #191

Open karenfeng opened 1 year ago

karenfeng commented 1 year ago

Any suggestions on how to fix the following error when calling susie_rss? It looks like it's being triggered pretty deep into the stack, so I'm not sure how to debug this on my own.

Error in res$alpha[i, ] : subscript out of bounds
In addition: Warning message:
In max(abs(z[!is.nan(z)])) :
  no non-missing arguments to max; returning -Inf
karenfeng commented 1 year ago

Oops! Seems like I passed in completely empty matrices/lists (size of 0). It'd be great if the error message were less confusing in the case of invalid input.

pcarbo commented 1 year ago

Thanks for the suggestion @karenfeng. I've added this check to susie_rss. (And more generally I agree we could be doing a better job of checking inputs.)