4

I have the following Rmarkdown document:

---
title: "Test"
runtime: shiny 
author: "FOO"
date: "11/28/2017"
output: html_document
---

```{r echo = FALSE}

checkboxInput("rowzscore","Row Z-Score", TRUE) 

```

``` {r echo = FALSE}
 plotly::renderPlotly({
    scale <- "none"
    if (input$rowzscore) {
      scale <- "row"
    }

    heatmaply::heatmaply(as.matrix(mtcars),
                         hclust_method = "ward.D2",
                         distfun = "pearson",
                         scale = scale
                )

  })


```

Which generate this App. As shown the figure below, I'd like to increase the height of the plot. How can I do that?

enter image description here

I looked at the documentation of renderPlotly, it does not allow the resizing of the object.

I tried using plotlyOutput like this,

```{r echo = FALSE}
shinyApp(
  ui <- fluidPage(
    checkboxInput("rowzscore","Row Z-Score", TRUE) ,
    plotly::plotlyOutput('cool_plot', height="1000px")
  ),
  server <- function(input,output) {
   output$cool_plot <-  plotly::renderPlotly({ 
        scale <- "none"
        if (input$rowzscore) {
          scale <- "row"
        }

        heatmaply::heatmaply(as.matrix(mtcars),
                             hclust_method = "ward.D2",
                             distfun = "pearson",
                             scale = scale
                    )
      })
  }

)
```

the image getsenter image description here further truncated:

What's the right way to do it?

Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
littleworth
  • 4,781
  • 6
  • 42
  • 76

0 Answers0