title: Insert alternating vectors into data frame
body: <p>I have two vectors:</p>
  
  <pre><code>a &lt;- c(ceiling(seq(0, top, length.out = 20)))
  
  b &lt;- c(floor(seq(100, bottom, length.out = 20)))
  
  a : 1  2  2  2  3  3  3  4  4  4  5  5  5 .....
  
  b : 100  98  96  95  93  91  90  88  86  85  83  82 .....
  </code></pre>
  
  <p>I would like to create a data frame by alternating the vector items, and adding an extra variable. 1 for a vector a component, -1 for a vector b component.</p>
  
  <pre><code>number sign
  1      1
  100    -1
  2      1
  98    -1
  </code></pre>
  
  <p>etc...</p>
  
  <p>And if one vector is longer than the other (if there is no more alternating possible), that its remaining values be added at the end of the data frame.
  I have something like this:</p>
  
  <pre><code>for (n in [1:length(a)]) {
  dataframe[nrow(dataframe)+1,] &lt;- c(a[n],1)
  dataframe[nrow(dataframe)+1,] &lt;- c(b[n],-1)
  }
  </code></pre>
  
  <p>This is only adding the first value from each vector, and returning:
      Error: unexpected '}' in "  }"</p>
  
  <p>I'm at a loss here..
  Help much appreciated. Thank you!</p>