user4791235
user4791235

Reputation:

Shiny Application: ggplot() shows up in RStudio Viewer and not my mainpanel

I've written a shiny application that functions properly with no errors, but every time I run the program, the ggplot() gets plotted in RStudio's Viewer Panel, but I want it to show up in the mainpanel. How do I get it to switch and plot in my mainPanel of my shiny application?

In my code, my mainPanel isn't inside my sidebarPanel, and my plotOutput gets called correctly.

mainPanel(plotOutput("plot1"))

Here's the server call to plot1. All my dataframe manipulation and my ggplot() code is within data1()

output$plot1 <- renderPlot({data1()})  

Upvotes: 1

Views: 1024

Answers (1)

chasemc
chasemc

Reputation: 869

Instead of

plotOutput() and renderPlot()

use:

ggiraphOutput() and renderggiraph()

Upvotes: 0

Related Questions