title: Add or multiply a different value by factor level
body: <p>Is there a smarter way than the following to do a simple arithmetic operation to a data frame column by a factor level?</p>
  
  <pre><code>data &lt;- runif(100,0,1)
  df &lt;- data.frame(x = data,
                   class = cut(data, breaks = c(0,0.5,1), labels = c("low", "high")))
  df$x2 &lt;- ifelse(df$class == "high", df$x - 1, df$x + 1)
  </code></pre>
  
  <p>I have a data frame with several factor levels and would like to add / multiply the values with a vector of different values. I though maybe something with <code>split</code> could work? </p>