R Shiny 的情节布局用户界面

标签 r shiny

关于在 r Shiny UI 中格式化绘图位置的快速问题。

到目前为止,我已经在 Server.R 中制作了一系列直方图,它们都在 UI 中完美显示。唯一的问题是,我希望它们排成两排,每排 4 排。我当前的代码,粘贴在下面,给了我 3 行!最上面的有 4 张图,第二张有 3 张图(有空间容纳第四张图),然后最后一行有 1 个图...我哪里出错了,有没有更好的方法来布置 8 个 Shiny 的图?

fluidRow(
   column(12,
       "",
       fluidRow(
         column(3,
                plotOutput("PlotHy")#,

         ),
         column(width = 3,
                plotOutput("PlotMe")),
         column(width = 3,
                plotOutput("PlotEthane")),
         column(width = 3,
                plotOutput("PlotEthylene")),
         column(width = 3,
                plotOutput("PlotCO")),
         column(width = 3,
                plotOutput("PlotCO2")),
         column(width = 3,
                plotOutput("PlotO")),
         column(width = 3,
                plotOutput("PlotN"))
       )
)
),

谢谢,詹姆斯

最佳答案

只需显式行分隔:

shinyUI(
    fluidPage(

    titlePanel("stack overflow question"),

    fluidRow(
    column(12,
           "",
           fluidRow(
               column(3,
                      plotOutput("PlotHy")),
               column(width = 3,
                      plotOutput("PlotMe")),
               column(width = 3,
                      plotOutput("PlotEthane")),
               column(width = 3,
                      plotOutput("PlotEthylene"))
           ), fluidRow(
               column(width = 3,
                      plotOutput("PlotCO")),
               column(width = 3,
                      plotOutput("PlotCO2")),
               column(width = 3,
                      plotOutput("PlotO")),
               column(width = 3,
                      plotOutput("PlotN"))
           )
    )
)
))

关于R Shiny 的情节布局用户界面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24948700/

相关文章:

r - 如何在 R 中引导重新采样计数数据

r - 如何在Shiny Application的onStart参数中设置全局变量值

R Shiny 输入 slider 范围值

html - Shiny 的 HTML UI :

R 时区从 CEST (UTC+2) 到 UTC

r - 附加到 Rcpp 列表中的元素

r - tidyverse 解决方案,用于将多个列重新编码为新列,其中列名后缀增加一

r - 如何部署使用本地数据的 Shiny 应用程序

r - 如何让 Shiny 等到你点击提交

c++ - 在 Rcpp (Armadillo) 函数中使用数字序列作为默认参数