title: Mixed Integer Linear Programming in R
body: <p>I'm looking to solve problems of the form in R:</p>
  
  <p><a href="https://i.stack.imgur.com/4ZT9c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4ZT9c.png" alt="enter image description here"></a></p>
  
  <p>where</p>
  
  <p><a href="https://i.stack.imgur.com/PXLRZ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PXLRZ.gif" alt="enter image description here"></a></p>
  
  <p>and</p>
  
  <p><a href="https://i.stack.imgur.com/9iz0k.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9iz0k.gif" alt="enter image description here"></a></p>
  
  <p>is an indicator function that equals 1 if the argument (.) is true and zero otherwise.</p>
  
  <p>I've looked into packages lpSolve, Rcplex, and crs but I couldn't quite grasp how I would place my problem into the functions offered by those packages. I don't really know how I would incorporate my indicator functions in the objective. I thought about making my controls the binary W's themselves but then I would have to provide the lambdas (weights), however, my interest is finding the optimal combination of lambdas, and not the W's. </p>