title: Create bin intervals for a range in R for two different variables
body: <p>I would like to create two bin intervals, one for "Sales", and another for "PCT change", for the Product Category at the same time. The "PCT change" varies from -ve to +ve, and Sales range from $2000 to $19000.</p>
  
  <p>Below is my dataset.</p>
  
  <pre><code>Product,Sales,PCT Change
  A,4769,0.72
  A,9841,0.14
  A,2594,-0.37
  A,15970,-0.76
  A,18142,0.9
  A,19935,0.63
  A,19023,0.63
  A,4097,-0.31
  A,17318,-0.38
  A,15533,1.14
  A,7596,0.74
  A,4099,0.06
  B,7294,-0.45
  B,5473,-0.81
  B,5813,-0.31
  B,4084,0.8
  B,10446,0.08
  B,3820,0.12
  B,3208,0.02
  B,10100,-0.82
  B,19125,0.14
  B,7332,0.9
  C,1870,0.28
  C,5949,-0.62
  C,2739,0.98
  C,14388,0
  C,19307,1.08
  C,12312,0.68
  C,15120,0.08
  C,16456,0.24
  C,1063,0.64
  C,3587,-0.07
  C,15480,0.31
  C,8934,0.79
  C,10392,0.57
  C,9705,0.87
  C,18181,0.93
  C,4700,-0.88
  C,7392,-0.79
  C,7504,-0.75
  C,14943,1.06
  </code></pre>
  
  <p>Below is the code i am trying.</p>
  
  <pre><code>df %&gt;%
  group_by(Product) %&gt;%
  mutate(freq=cut(Sales, breaks=seq(0,8000,by=50), include.lowest=TRUE))
  </code></pre>
  
  <p>I am not sure how the breaks will help.. I don't want to create more than 10 size of different bin. Also, not sure how to append the "PCT change" as well in the same code, to bring in two different intervals.</p>
  
  <p>Expected output:</p>
  
  <pre><code>Product,Sales,PCT Change
      A,4769,0.72, [4000-5000],[0.65-0.78]
      A,9841,0.14 ,[9000-10000],[0.04-0.17]
      B,2594,-0.37,[2000-3000],[-0.39- -0.31]
  </code></pre>
  
  <p>Also, i am looking options to customize the range, suppose i want to bring 4500-5000 instead of 4000-5000. I am running a simulation actually, hence want to explore feasible options.</p>
  
  <p>Any leads would be highly appreciated.</p>
  
  <p>Thanks,
  J</p>