title: Shiny plotOutput dynamic properties
body: <p>I have a plot that depends on user's input.
  Depending on the input, the plot size will be different.</p>
  
  <p>Can I control dynamically the plot's height?
  I know that in <code>plotOutput()</code> I have a height argument, but I can't find a way to change it dynamically.</p>
  
  <p>Reproducible example, when you choose A, the plot looks fine, but if you choose B it's much to high-</p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  df1 &lt;- data.frame(x = 1:2000, y = rnorm(2000), type = rep(LETTERS[1:8], 250))
  df2 &lt;- data.frame(x = 1:100, y = rexp (100), type = rep(c('A','B'), 50))
  
  ui &lt;- shinyUI(fluidPage(title = '',
    fluidRow(selectInput("table",'', choices = c('A','B'))),
    fluidRow(plotOutput("my_plot", height = '1000px'))
    )
  )
  
  server &lt;- shinyServer(function(input, output) {
    output$my_plot &lt;- renderPlot({
      t &lt;- if(input$table == 'A') df1
      else df2
      ggplot(t) + facet_grid(type~.) +
        geom_point(mapping = aes(x=x, y=y))
    }
    )
  })
  shinyApp(ui, server)
  </code></pre>
  
  <p>One last thing, in the real app it's not that I have 2 different sizes, depending on the input the size needs to change. </p>