如何在一个面板中包含renderPrint()和其他渲染

时间:2017-06-28 00:57:05

标签: r shiny flexdashboard

我有以下Shiny-Rmarkdown应用程序:

---
title: "My First Shiny"
runtime: shiny
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: scroll
---


```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(d3heatmap)
library(ggplot2)
```


Rows {data-height=800}
-----------------------------------------------------------------------

### Plot1

Here is the attempt


```{r}
# x <- datasets::iris[,-5] # [c(2:4,7),1:4]
checkboxInput("cluster", "Apply clustering")

renderD3heatmap(
  d3heatmap(mtcars, 
          dendrogram = if (input$cluster) "both" else "none",
          scale="none",
          xaxis_height = 170,
          yaxis_width = 170,
          height=200,
          cexRow = 1.0, 
          cexCol = 1.0,
          k_row = 6,
          k_col = 6
          )

)

renderPrint({tibble::as.tibble(mtcars)})

```

*** 

Some commentary about Frame 2.

### Plot2

它生成以下应用程序:

enter image description here

请注意,虽然我有这一行:

renderPrint({tibble::as.tibble(mtcars)})

它没有显示在Plot1面板的底部。什么是正确的方法?

1 个答案:

答案 0 :(得分:0)

public GridBench2() { InitializeComponent(); DataContext = this; } public double ZoomX { get { return Width / 300; } } public double ZoomY { get { return Height / 300; } } public event PropertyChangedEventHandler PropertyChanged; private void Window_SizeChanged(object sender, SizeChangedEventArgs e) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ZoomX")); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ZoomY")); } 没有renderD3heatmap outputArgs用于将renderPlotwidth个参数传递给height,所以我认为你不能那样做。

相反,您可能希望使用plotOutput并创建2列,然后将其拆分:

orientation: columns

enter image description here