I am running Shiny
in R to create a GUI, and I receive the following error: ERROR: argument "mainPanel" is missing, with no default
However, as you can see from my code below in the ui.r file, I do have mainPanel
included at the bottom, which should be getting successfully passed to 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")
)
)
)
I have also made sure to include a comma before mainPanel
, as suggested in Error in RShiny ui.r argument missing
Any suggestions are greatly appreciated.
The mainPanel
needs to be called inside the sidebarLayout
function. See ?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")
)
)
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With