如何在 Shiny flexdashboard 中扩展 renderTable 的宽度 [英] How to extend the renderTable width in Shiny flexdashboard
本文介绍了如何在 Shiny flexdashboard 中扩展 renderTable 的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下包含 Shiny-Flexdashboard 的自我:
I have the following self containing Shiny-Flexdashboard:
---
title: "FOO"
runtime: shiny
output:
flexdashboard::flex_dashboard:
vertical_layout: scroll
orientation: rows
theme: default
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
```
Rows
-------------------------------------
### Statistical Test Summary
```{r stat_test_table}
mainPanel(
renderTable( {
dat <- df <- structure(list(`Sample name` = structure(1:3, .Label = c("Sample1",
"Sample2", "Sample3"), class = "factor"), `FDR correction (mean)` = c(5.93070861978308e-15,
6.88632524238004e-13, 3.28339498763286e-16), `FDR correction (sd)` = c(2.00046170407461e-14,
2.32019633515427e-12, 1.10782095003689e-15), `P-value (mean)` = c(5.55365134900322e-15,
6.44757191496266e-13, 3.07475941705412e-16), `P-value (sd)` = c(1.98732517127302e-14,
2.30494707691577e-12, 1.10054774779699e-15)), class = c("tbl_df",
"tbl", "data.frame"), .Names = c("Sample name", "FDR correction (mean)",
"FDR correction (sd)", "P-value (mean)", "P-value (sd)"), row.names = c(NA, -3L))
}
, digits=-2, width = '100%'
)
)
```
它产生这样的表格:
如上所述,如何扩展列宽?
As stated there how can I extend the column width?
推荐答案
有趣.如果您查看 ?mainPanel()
的文档.您将看到宽度默认限制为8"(最大为 12):mainPanel(..., width = 8)
Interesting. If you look at the docu of ?mainPanel()
. You will see that the width is by default restricted to "8" (12 is the max):
mainPanel(..., width = 8)
因此,如果您简单地更改为:mainPanel(..., width = 12)
就可以了.
So if you simplfy change to:
mainPanel(..., width = 12)
it will work.
这篇关于如何在 Shiny flexdashboard 中扩展 renderTable 的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文