Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R图布局用户界面_R_Shiny - Fatal编程技术网

R图布局用户界面

R图布局用户界面,r,shiny,R,Shiny,关于在r-UI中设置绘图位置格式的快速问题 到目前为止,我已经在Server.R中绘制了一系列柱状图,它们都完美地显示在UI中。唯一的问题是,我希望他们排成2行,4对一行。我当前的代码,粘贴在下面,给了我3行!最上面的一行有4个图形,第二行有3个图形(有空间容纳第四个图形),最后一行有1个绘图。。。我哪里出了问题,有没有更好的方法在shiny中布局8个图 fluidRow( column(12, "", fluidRow( column(3,

关于在r-UI中设置绘图位置格式的快速问题

到目前为止,我已经在Server.R中绘制了一系列柱状图,它们都完美地显示在UI中。唯一的问题是,我希望他们排成2行,4对一行。我当前的代码,粘贴在下面,给了我3行!最上面的一行有4个图形,第二行有3个图形(有空间容纳第四个图形),最后一行有1个绘图。。。我哪里出了问题,有没有更好的方法在shiny中布局8个图

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"))
       )
)
),

谢谢,James一个解决方案是,用R自己做

像这样的

shinyServer(function(input, output, session) {
  output$plot <- renderPlot({
    par(mfrow=c(2,2))
    h1 <- hist(rnorm(100))
    h2 <- hist(rnorm(100))
    h3 <- hist(rnorm(100))
    h4 <- hist(rnorm(100))
  })
})
shinyServer(功能(输入、输出、会话){

输出$plot仅显示行分隔:

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"))
           )
    )
)
))

这是一个非常有趣的方法