Here is my R code for a shiny app I am creating.
ui <- fluidPage(
useShinyjs(),
dashboardHeader(title = "Lineup Optimizer"),
dashboardSidebar(
sidebarMenu(
menuItem("Home", tabName = "home", icon = icon("home")),
menuItem(" Current Roster", tabName = "roster", icon = icon("chart-line")),
menuItem(" Incoming Players", tabName = "incoming", icon = icon("check-to-slot")),
menuItem(" Outgoing Players", tabName = "outgoing", icon = icon("gamepad")),
menuItem(" Optimization Tool", tabName = "optimize", icon = icon("gamepad"))
)
),
dashboardBody(
tags$head(tags$style(HTML('
.skin-blue .main-header .logo {
background-color: #173151;
color: #FFFFFF;
border-bottom: 0 solid transparent;
}
.skin-blue .main-header .logo:hover {
background-color: #173151;
}
.skin-blue .main-header .navbar {
background-color: #173151;
}
.skin-blue .main-sidebar {
background-color: #173151;
}
.skin-blue .main-sidebar .sidebar .sidebar-menu .active a {
background-color: #D5B116;
color: #FFFFFF;
}
.skin-blue .main-sidebar .sidebar .sidebar-menu a {
color: #FFFFFF;
}
.skin-blue .main-sidebar .sidebar .sidebar-menu a:hover {
background-color: #D5B116;
}
.skin-blue .main-sidebar .sidebar .sidebar-menu .active a:hover {
background-color: #D5B116;
}
.content-wrapper, .right-side {
background-color: #EDF0F5;
}
'))),
tabItems(
tabItem(tabName = "home",
h2("Welcome back, Virginia Softball!"),
h3("Here are the most recent updates.")
),
tabItem(tabName = "roster",
h2("Welcome back, Virginia Softball!"),
h3("Here are the most recent updates.")
),
tabItem(tabName = "incoming",
h2("Welcome back, Virginia Softball!"),
h3("Here are the most recent updates.")
),
tabItem(tabName = "outgoing",
h2("Welcome back, Virginia Softball!"),
h3("Here are the most recent updates.")
),
tabItem(tabName = "optimize",
h2("Welcome back, Virginia Softball!"),
h3("Here are the most recent updates.")
),
)
)
)
I am getting the following error:
> runApp('best_fit_app.R') Error in tabItems(tabItem(tabName = "home", h2("Welcome back, Virginia Softball!"), : argument is missing, with no default
I copied this code from a previous app I’ve made and know works, so not sure why this is coming up. Any help is appreciated! I’ve tried removing the h2 and h3 elements, adding new arguments that I didn’t previously have in there. Not sure.
New contributor
Joe Leonard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1