title: Calculate mean across 2 variables of a 3 variable data.frame
body: <p>I have a data frame with color, quality and price and I want to compare how the color changes perception of quality.<br>
  I need to get a table with the mean of the prices for every color and quality combination.<br>
  I am currently trying with aggregate but I can't seem to find the proper combination.</p>
  
  <p><code>aggregate(price ~ color, list(Quality = D$quality), data=D, FUN=mean);</code></p>
  
  <p>Input:<br>
  <code>Quality   | Color | Price
  Good      | Red   | 4500
  Excellent | Green | 5000
  Bad       | Blue  | 420
  ......
  </code>
  Output: mean prices table<br>
  <code>.         Red .    Blue . Green
  Excellent . 4520 .  4200 .  3500 
  Good .      3950 .  3722 .  3021
  Bad .       1523 .  1232 .  900</code></p>