title: Visualize multiple plots in one renderPlot - rshiny
body: <p>I am trying to build my first shiny app and here is my sample code below:</p>
  <pre><code>library(shiny)
  library(ggplot2)
  library(gridExtra)
  data('mtcars')
  
  if (interactive()) {
    shinyApp(
      ui = fluidPage(
        sliderInput('num',label='Insert Number of clusters',value = 3,min = 2,max = 10,step = 1),
        plotOutput(&quot;data&quot;)
      ),
      server = function(input, output) {
        
        output$data&lt;-renderPlot({autoplot(kmeans(mtcars,input$num),data=mtcars,label=TRUE,label.size=3)})
        }
    )}
  </code></pre>
  <p>Now want I am trying to achieve is to combine the clusters with the original data and visualize the histogram and box plot of all variables after grouping them by the cluster column. For instance,</p>
  <p>My final data can be as follows if the user chooses 5 clusters:</p>
  <pre><code>mtcars_with_clsuters&lt;-cbind(mtcars,clusters$cluster)
  
                       mpg cyl  disp  hp drat    wt  qsec vs am gear carb   cluster
  Mazda RX4           21.0   6 160.0 110 3.90 2.620 16.46  0  1    4    4      3
  Mazda RX4 Wag       21.0   6 160.0 110 3.90 2.875 17.02  0  1    4    4      5
  Datsun 710          22.8   4 108.0  93 3.85 2.320 18.61  1  1    4    1      2
  Hornet 4 Drive      21.4   6 258.0 110 3.08 3.215 19.44  1  0    3    1      2
  Hornet Sportabout   18.7   8 360.0 175 3.15 3.440 17.02  0  0    3    2      4
  Valiant             18.1   6 225.0 105 2.76 3.460 20.22  1  0    3    1      2
  Duster 360          14.3   8 360.0 245 3.21 3.570 15.84  0  0    3    4      1
  Merc 240D           24.4   4 146.7  62 3.69 3.190 20.00  1  0    4    2      2
  Merc 230            22.8   4 140.8  95 3.92 3.150 22.90  1  0    4    2      4
  Merc 280            19.2   6 167.6 123 3.92 3.440 18.30  1  0    4    4      4
  Merc 280C           17.8   6 167.6 123 3.92 3.440 18.90  1  0    4    4      2
  Merc 450SE          16.4   8 275.8 180 3.07 4.070 17.40  0  0    3    3      3
  Merc 450SL          17.3   8 275.8 180 3.07 3.730 17.60  0  0    3    3      1
  Merc 450SLC         15.2   8 275.8 180 3.07 3.780 18.00  0  0    3    3      1
  Cadillac Fleetwood  10.4   8 472.0 205 2.93 5.250 17.98  0  0    3    4      4
  Lincoln Continental 10.4   8 460.0 215 3.00 5.424 17.82  0  0    3    4      5
  </code></pre>
  <p>so now I want to group my data by the cluster column and visualize it next to the k-means cluster visualization inside <code>renderPlot</code> above.</p>
  <p>Any help with this would be highly appreciated.</p>