Here is a example of my setup. Assuming there is a plotOutput("example")
in the UI function, this will go in the server function:
output$example <- renderPlot({ testPlot() })
testPlot <- function() {
ggplot(data = mpg, mapping = aes(x = displ, y = hwy, color= drv)) +
geom_smooth(mapping = aes(linetype = drv), method = 'loess') +
geom_point()
}
this example code itself works fine, the plot appears on the app page. But when I run my code (which is structured similarly, it has a renderPlot which makes a call to a function that returns a ggplot), the plot shows up in a separate window.
What could be causing the plot to open in a separate popup window rather than render in the app? No ggplot options would cause this as far as I'm aware.