gpt4 book ai didi

r - 如何在 Shiny flexdashboard 中扩展 renderTable 的宽度

转载 作者:行者123 更新时间:2023-12-04 11:01:04 25 4
gpt4 key购买 nike

我有以下包含 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%'
)
)
```

它产生这样的表:

enter image description here

如上所述,如何扩展列宽?

最佳答案

有趣的。如果您查看 ?mainPanel() 的文档.您将看到宽度默认限制为“8”(最大为 12):mainPanel(..., width = 8)
因此,如果您简单地更改为:mainPanel(..., width = 12)它会起作用。

关于r - 如何在 Shiny flexdashboard 中扩展 renderTable 的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44214837/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com