ERROR: argument "mainPanel" is missing, with no default ?

1,391 views
Skip to first unread message

Iasmim Louriene

unread,
Sep 29, 2016, 1:48:45 PM9/29/16
to Shiny - Web Framework for R
Hello guys,

I'm havin the following Error message: argument "mainPanel" is missing, with no default, for the following script:

shinyUI(fluidPage(
titlePanel(title = h4("Demonstration of renderPlot() - a histogram", align="center")),
sidebarLayout(
sidebarPanel(
selectInput("var", "1.Select the variable from the iris dataset", choices= c("Sepal.Lenght" = 1, "Sepal.Width" = 2, "Petal.Length" = 3, "Petal.Width" = 4, selected =1)),
br(),
sliderInput("bins", "2.Select the number of BINs for histogram", min=5, max =25, value=15),
br(),
radioButtons("color", "3.Select the color of histogram", choices=c("Green", "Red", "Yellow", selected = "Green")
),
mainPanel(
plotOutput("myhist")
)
))

))


Could anyone please help me?
I really appreciate :)

Joe Cheng

unread,
Sep 29, 2016, 2:04:38 PM9/29/16
to Iasmim Louriene, Shiny - Web Framework for R
You've put your mainPanel inside your sidebarPanel--they should be peers.

shinyUI(fluidPage(
  titlePanel(title = h4("Demonstration of renderPlot() - a histogram", align="center")),
  sidebarLayout(
    sidebarPanel(
      selectInput("var", "1.Select the variable from the iris dataset", choices= c("Sepal.Lenght" = 1, "Sepal.Width" = 2, "Petal.Length" = 3, "Petal.Width" = 4, selected =1)),
      br(),
      sliderInput("bins", "2.Select the number of BINs for histogram", min=5, max =25, value=15),
      br(),
      radioButtons("color", "3.Select the color of histogram", choices=c("Green", "Red", "Yellow", selected = "Green"))
    ),
    mainPanel(
      plotOutput("myhist")
    )
  )
))

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/060d0a72-82a6-48e5-b61f-254412b6e167%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Iasmim Louriene

unread,
Sep 29, 2016, 2:19:39 PM9/29/16
to Shiny - Web Framework for R
Ohhhh I see it! Got it Joe!

Thanks a lot man! :)

Reply all
Reply to author
Forward
0 new messages