Heatmap not drawn in app window but viewer pane

Hi all,
I'm having a weird issue/bug while working on my shiny app. At some point in the process, I draw a heatmap with the pheatmap package (with renderPlot, as usual), but the heatmap is not drawn in the app window. Instead, it is drawn in the Viewer pane. The issue persists until I restart the R session.
I think the issue is that previously in the session, I've used the Viewer pane (with RColorBrewer::display.brewer.all() for instance). Furthermore, the issue does not concern ggplots.
Should I post a bug?

Small reproducible example (one should run RColorBrewer::display.brewer.all() beforehand, and choose "Run in Window" for the app) :

library(shiny)
library(pheatmap)
library(ggplot2)
library(dplyr)

ui <- fluidPage(
  title = "Heatmap",
  plotOutput("heatmap"),
  plotOutput("plot")
)

server <- function(input, output, session) {
  output$heatmap <- renderPlot(
    {
      data <- mtcars %>% 
        select(where(is.numeric))
      data_cor <- cor(t(data))
      pheatmap(
        mat = as.matrix(data_cor)
      )
    }
  )
  output$plot <- renderPlot({
    mtcars %>% ggplot(aes(x = mpg, y = hp)) +
      geom_point()
  })
}

shinyApp(ui, server)

I'm running Rstudio in Fedora 34, in a Wayland session. Rstudio version is 1.4.1717-2.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.