title: Converting a vector into formula
body: <p>Given a data.frame and a vector only with -1,0,1 with length equal to the number of columns of the data.frame. Is there a natural way to transform the vector into a formula with those elements in position with a -1 appear on the left side of the formula and those with +1 appear on the right side?</p>
  
  <p>For example, given the following data.frame</p>
  
  <pre><code>df = data.frame(
    'a' = rnorm(10),
    'b' = rnorm(10),
    'c' = rnorm(10),
    'd' = rnorm(10),
    'e' = rnorm(10))
  </code></pre>
  
  <p>and following vector <code>vec = c(-1,-1,0,1,1)</code>.</p>
  
  <p>Is there a natural way to build formula <code>a+b~d+e</code>?</p>