title: Using cut() and quantile() to bucket continuous columns in R
body: <p>I have the following generated df with ages and weights</p>
  <pre><code>df = data.frame(
      Age = sample(18:98, 1000, replace = TRUE),
      Weight = sample(80:250, 10000, replace = TRUE)
  )
  
  </code></pre>
  <p>I want to alter the continuous columns by creating buckets based on the quantiles (25%, 50%, 75%. This can be done like so:</p>
  <pre><code>&gt; quantile(df$Age, probs = c(0.25,0.5,0.75))
  25% 50% 75% 
   39  58  78
  </code></pre>
  <p>However, I want to use the cut function using these quantiles (25%, 50%, 75%)</p>
  <p>How can I do this? I want the output to transform to something like this, where any continuous variable is converted to buckets based on the quantile (25%, 50%, 75%)</p>
  <pre><code>Age          Weight
  (17.9,44.7]  (137,193]
  (44.7,71.3]  (137,193]
  (71.3,98.1]  (79.8,137]
  (44.7,71.3]  (193,250]
  (17.9,44.7]  (79.8,137]
  </code></pre>