作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下 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
它生成以下应用:
请注意,虽然我有这一行:
renderPrint({tibble::as.tibble(mtcars)})
它不显示在 Plot1
面板的底部。正确的做法是什么?
最佳答案
renderD3heatmap
没有outputArgs
renderPlot
使用的通过width
和 height
plotOutput
的参数,所以我认为你不能那样做。
相反,您可能想使用 orientation: columns
并创建 2 列,然后将其拆分:
---
title: "My First Shiny"
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: scroll
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(d3heatmap)
library(ggplot2)
```
Column
-----------------------------------------------------------------------
### Plot1
Here is the attempt
```{r}
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
))
```
### Data
```{r}
renderPrint({tibble::as_tibble(mtcars)})
```
***
Some commentary about Frame 2.
Column
-----------------------------------------------------------------------
### Plot2
关于r - 如何在一个面板中包含 renderPrint() 和其他渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44792090/
我是一名优秀的程序员,十分优秀!