Forum: help
Monitor Forum | Start New ThreadlpSolve problem [ Reply ] By: C S on 2020-10-21 17:18 | [forum:48302] |
Whenever I run the following script: m = length(mean_vect) library(linprog) AmatLP1 = cbind(diag(1,nrow=m),matrix(0,nrow=m,ncol=m)) AmatLP2 = cbind(matrix(0,nrow=m,ncol=m),diag(1,nrow=m)) AmatLP3 = c(rep(1,m),rep(-1,m)) AmatLP = rbind(AmatLP1,AmatLP2,AmatLP3) B2 = 0.5 B1 = 0.15 bvecLP = c(rep(B1,m),rep(B2,m),1) cLP = c(mean_vect,-mean_vect) const.dir = c(rep("<=",2*m),"=") resultLP_min = solveLP(cvec=cLP,bvec=bvecLP,Amat=AmatLP, lpSolve=F,const.dir = const.dir,maximum=FALSE) resultLP_max = solveLP(cvec=cLP,bvec=bvecLP, Amat=AmatLP,lpSolve=F,maximum=TRUE) mu_bounds = c(resultLP_min$opt,resultLP_max$opt) I get these warnings and I would appreciate anyone's input to resolve it! Warning messages: 1: In if (lpSolve) { : the condition has length > 1 and only the first element will be used 2: In if (lpSolve) { : the condition has length > 1 and only the first element will be used |