I'm having a common issue with R and am aware the questions has been asked many times before... still having trouble debugging exactly how the error occurs in my code. Hoping someone can help out.
The offending bit of code is as follows:
constraintIndex = which(constraintChoice == getParameters()$constraints)
loginfo("89: '%s'", constraintIndex) # logs successfully as '4'
if (constraintIndex <= 0) constraintIndex <- 1
myConstraints = switch(constraintIndex, noConstraints, sumOneConstraints, nonNegConstraints, allConstraints)
problem <- Problem(objective, constraints = myConstraints)
loginfo("97: '%s'", someinfo) # reaches here just fine
result <- solve(problem)
loginfo("99: '%s'", someinfo) # never hits this point
Log output:
(previous logging)
INFO::89: '4'
INFO::97: 'someinfo'
INFO::Function returned: {"errorCode":[1],"errorResponse":["missing value where TRUE/FALSE needed"]
So it hits line 97 and logs just fine, but fails at result <- solve(problem)
Resources:
Error in if/while (condition) {: missing Value where TRUE/FALSE needed
R - " missing value where TRUE/FALSE needed "
"missing value where TRUE/FALSE needed" Error in if statement in R
Once again, I'm aware it's been asked but still do not have enough info to solve my problem.