I am trying to use selectInput to select through different ggplots entirely using renderPlotly

Hey, just FYI, there's a stray comma following your call to plotlyOutput() that causes an error when I copy and paste your code.

Also, it would be very helpful to have a full reproducible example, or reprex, so people can see the exact problem you're having and debug it. It looks like you're pretty close to one, which is great! I think it would all run if you created some dummy data for metric2. See the reprex FAQ:

And here's the FAQ on debugging a shiny app:

Just glancing through your code, I do note a couple things:

  • renderPlotly() takes an expression (or maybe function? I'm not certain) as the first argument (The stuff surrounded by {}), and that expression only returns the last line evaluated, so for displaying 2 plots, you'll need 2 calls to renderPlotly(). Is your app currently displaying only the second plot?
  • Your if() conditions will never evaluate to FALSE.
  • Your plots don't access any input values, so they will never update.