title: Binning continuous data to stack histogram in R
body: <p>I have a dataset that looks like this:</p>
  
  <pre><code>USER.ID avgfrequency    orders  group
  1   3   3.7821782   101 3
  2   7   14.7500000  8   3
  3   9   13.4761905  21  3
  4   13  5.1967213   61  3
  5   16  6.7812500   64  3
  6   26  41.7500000  4   2
  7   49  13.6666667  3   2
  8   50  7.0000000   1   1
  9   51  1.0000000   1   1
  10  52  17.7500000  4   2
  11  69  4.5000000   2   1
  12  75  9.9500000   20  3
  13  91  84.2000000  5   2
  14  98  8.0185185   54  3
  15  138 14.2000000  5   2
  16  139 34.7500000  4   2
  17  149 7.6666667   21  3
  18  155 35.3333333  9   3
  19  167 24.0000000  1   1
  20  170 7.3529412   34  3
  21  171 4.4210526   76  3
  22  174 4.5000000   2   1
  23  175 6.5781250   64  3
  24  176 19.2857143  21  3
  25  177 10.4864865  37  3
  26  178 28.0000000  15  3
  27  180 4.8461538   39  3
  28  183 25.5000000  2   1
  29  184 13.0000000  1   1
  30  210 32.0000000  1   1
  31  215 13.4615385  13  3
  32  220 11.3611111  36  3
  33  223 26.2500000  8   3
  34  224 40.5000000  8   3
  35  230 15.4000000  10  3
  36  232 14.6666667  3   2
  37  234 34.5833333  12  3
  38  238 138.5000000 2   1
  39  240 7.0000000   3   2
  40  243 35.0000000  3   2
  41  246 6.7500000   4   2
  42  247 8.5000000   50  3
  43  258 17.6666667  3   2
  44  283 23.5000000  2   1
  45  295 19.5625000  16  3
  46  300 81.6666667  3   2
  47  311 34.4166667  12  3
  48  338 64.0000000  1   1
  49  342 113.3333333 3   2
  50  343 197.0000000 1   1
  51  347 3.6923077   13  3
  52  350 4.6666667   3   2
  53  360 177.5000000 2   1
  54  361 39.0000000  10  3
  55  362 1.4000000   5   2
  56  365 15.0000000  24  3
  57  366 59.2000000  5   2
  58  367 5.0000000   4   2
  59  369 27.9285714  14  3
  60  372 63.6666667  3   2
  61  375 9.3750000   8   3
  62  377 13.3225806  31  3
  63  380 169.5000000 2   1
  64  383 23.2352941  17  3
  65  391 0.0000000   1   1
  </code></pre>
  
  <p>I want to split <code>avgfrequency</code> into different bins of width 10 and plot it as x-axis and on y-axis I want to show the count of USER.ID as histograms and in each bar I want to show count of USER.ID of different group with different color. So, each histogram would have three different colors for each bin.</p>
  
  <p>Is it possible to do it in R ?</p>