argument is missing, with no default in Shiny: Check Commas

Shiny is great but commas would kill you when you are coding with it.

Here is my example program modeled after a course I am doing online.

Save ui.R and server.R in one directory and run the program removing one of the commas. with runApp(), You would get an error message like: “Error in tag(“form”, list(…)) : argument is missing, with no default”.

# A shiny code requires two files: ui.R and server.R
# This code will be saved as ui.R


library(shiny) # call the Library to load into R
shinyUI(pageWithSidebar(
headerPanel(“Introduction to Shiny”),
sidebarPanel(
h1(‘Hello World’),
h2(‘Hello World’),
h3(‘Hello World’),
h4(‘Hello World’) #no comma in the last one
),
mainPanel(
h3(‘Text that goes in the main panel’),
code(‘Shiny is Great’),
p(‘publish with Shiny’) #no comma in the last one!
)
))


 
# A shiny code requires two files: ui.R and server.R
# This code will be saved as server.R
library(shiny) # call the Library to load into R
shinyServer(
function(input, output) {
}
)
 

So, be careful with commas when dealing with R coding in Shiny!

Shiny 2

Leave a Comment

Your email address will not be published. Required fields are marked *