Does any of you know where I can find an explanation of lapack errors codes? I get error code 17 when using optim(). Is there a way to handle errors in R such that depending on the type of error I can decide what to do next? Thanks, Haky