Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.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';的ui.r文件中缺少主面板参数;s闪亮的包装_R_Shiny - Fatal编程技术网

使用r';的ui.r文件中缺少主面板参数;s闪亮的包装

使用r';的ui.r文件中缺少主面板参数;s闪亮的包装,r,shiny,R,Shiny,我正在R中运行shinny来创建GUI,收到以下错误:错误:缺少参数“mainPanel”,没有默认值 但是,正如您从ui.r文件中下面的代码中看到的,我确实在底部包含了mainPanel,它应该能够成功地传递到sidebarLayout: require(shiny) shinyUI(fluidPage( titlePanel("Approach"), sidebarLayout( sidebarPanel( fileInput('file1', 'Choose fi

我正在R中运行
shinny
来创建GUI,收到以下错误:
错误:缺少参数“mainPanel”,没有默认值

但是,正如您从ui.r文件中下面的代码中看到的,我确实在底部包含了
mainPanel
,它应该能够成功地传递到
sidebarLayout

require(shiny)

shinyUI(fluidPage(
titlePanel("Approach"),
sidebarLayout(
    sidebarPanel(
        fileInput('file1', 'Choose file to upload',
                accept = c(
                    'text/csv',
                    'text/comma-separated-values',
                    'text/tab-separated-values',
                    'text/plain',
                    '.csv',
                    '.tsv'
                )
        )

    )
),
    mainPanel(
        plotOutput("plot")
    )



)
)
我还确保在
mainPanel
之前包含逗号,如中所建议的


非常感谢您的建议。

需要在
侧栏布局
函数中调用
主面板
。请参见侧边栏布局:

require(shiny)

shinyUI(fluidPage(
  titlePanel("Approach"),
  sidebarLayout(
    sidebarPanel(
      fileInput('file1', 'Choose file to upload',
                accept = c(
                  'text/csv',
                  'text/comma-separated-values',
                  'text/tab-separated-values',
                  'text/plain',
                  '.csv',
                  '.tsv'
                )
      )

    ),
    mainPanel(
      plotOutput("plot")
    )
  )
)
)