【发布时间】:2021-05-07 14:23:56
【问题描述】:
【问题讨论】:
标签: r r-markdown flexdashboard
【问题讨论】:
标签: r r-markdown flexdashboard
为了重现您的示例,我使用了一个闪亮的仪表板骨架,我将 infobox 放在了 column() 中,而 fluidRow 则放在了 fluidRow 中。诀窍是在列中添加 width = 3,align="center"。
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(fluidRow(
# A static infoBox
column( infoBox("New Orders", 10 * 2, icon = icon("credit-card")), width = 3,align="center"),
),)
)
server <- function(input, output) { }
shinyApp(ui, server)
要在Rmd 文件中呈现它,只需使用它
---
title: "Untitled"
author: "Daniel"
date: "5/6/2021"
output: html_document
runtime: shiny
---
```{r}
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(fluidRow(
# A static infoBox
column( infoBox("New Orders", 10 * 2, icon = icon("credit-card")), width = 3,align="center"),
),)
)
server <- function(input, output) { }
shinyApp(ui, server)
```
您必须放大 Rmarkdown 文件闪亮窗口才能获得响应效果。
【讨论】: