使用r';的ui.r文件中缺少主面板参数;s闪亮的包装
我正在R中运行使用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
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")
)
)
)
)