title: Getting a stacked area plot in R
body: <p>This question is a continuation of the previous <a href="https://stackoverflow.com/questions/5027480/how-to-add-a-new-column-and-aggregate-values-in-r">question</a> I asked.</p>
  
  <p>Now I have a case where there is also a category column with Prop. So, the dataset becomes like</p>
  
  <pre><code>Hour  Category        Prop2
  
  00     A            25
  00     B            59
  00     A            55
  00     C            5
  00     B            50
  ...
  01     C            56
  01     B            45
  01     A            56
  01     B            35
  ...
  23     D            58
  23     A            52
  23     B            50
  23     B            35
  23     B            15
  </code></pre>
  
  <p>In this case I need to make a stacked area plot in R with the percentages of these different categories for each day. So, the result will be like.</p>
  
  <pre><code>        A         B       C        D
  00     20%       30%     35%       15% 
  01     25%       10%     40%       25%
  02     20%       40%     10%       30% 
  .
  .
  .
  20 
  21
  22     25%       10%     30%       35%
  23     35%       20%     20%       25%
  </code></pre>
  
  <p>So now I would get the share of each Category in each hour and then plot this is a stacked area plot like this where the x-axis is the hour and y-axis the percentage of Prop2 for each category given by the different colours<img src="https://i.stack.imgur.com/PVTMr.png" alt="this"> </p>