Desperate Newbie - App stopped running

A shiny Newbie student desperately needing help - I have written the following very basic, probably the long way around, code... it WAS working and then it stopped. I have no idea what I did that made it stop but I certainly had not touched the server code.
Can anyone please help?
The error I am getting is:

Error in shinyApp(ui, server) : object 'server' not found

library("shiny")

max_rphatt <- max(WA_Health$rphatt, na.rm = TRUE)
max_rphadm <- max(WA_Health$rphadm, na.rm = TRUE)
max_fhatt <- max(WA_Health$fhatt, na.rm = TRUE)
max_fhadm <- max(WA_Health$fhadm, na.rm = TRUE)
max_pmhatt <- max(WA_Health$pmhatt, na.rm = TRUE)
max_pmhadm <- max(WA_Health$pmhadm, na.rm = TRUE)
max_kematt <- max(WA_Health$kematt, na.rm = TRUE)
max_kemadm <- max(WA_Health$kemadm, na.rm = TRUE)
max_scgatt <- max(WA_Health$scgatt, na.rm = TRUE)
max_scgadm <- max(WA_Health$scgadm, na.rm = TRUE)
max_jhcatt <- max(WA_Health$jhcatt, na.rm = TRUE)
max_jhcadm <- max(WA_Health$jhcadm, na.rm = TRUE)
max_rghatt <- max(WA_Health$rghatt, na.rm = TRUE)
max_rghadm <- max(WA_Health$rghadm, na.rm = TRUE)
max_sdhatt <- max(WA_Health$sdhatt, na.rm = TRUE)
max_sdhadm <- max(WA_Health$sdhadm, na.rm = TRUE)
max_akdatt <- max(WA_Health$akdatt, na.rm = TRUE)
max_akdadm <- max(WA_Health$akdadm, na.rm = TRUE)

body <- dashboardBody(
fluidRow(
valueBox(
subtitle = "Royal Perth Hospital Highest Daily Attendance",
value = max_rphatt,
icon = icon("ambulance"),
color = "green"
),
valueBox(
subtitle = "Royal Perth Hospital Highest Daily Admission",
value = max_rphadm,
icon = icon("hospital"),
color = "green"
),
),
fluidRow(
valueBox(
subtitle = "King Edward Hospital Highest Daily Attendance",
value = max_kematt,
icon = icon("ambulance"),
color = "aqua"
),
valueBox(
subtitle = "King Edward Hospital Highest Daily Admission",
value = max_kemadm,
icon = icon("hospital"),
color = "aqua"
),
),
fluidRow(
valueBox(
subtitle = "Fremantle Hospital Highest Daily Attendance",
value = max_fhatt,
icon = icon("ambulance"),
color = "blue"
),
valueBox(
subtitle = "Fremantle Hospital Highest Daily Admission",
value = max_fhadm,
icon = icon("hospital"),
color = "blue"
),
),
fluidRow(
valueBox(
subtitle = "Princess Margaret Hospital Highest Daily Attendance",
value = max_pmhatt,
icon = icon("ambulance"),
color = "fuchsia"
),
valueBox(
subtitle = "Princess Margaret Hospital Highest Daily Admission",
value = max_pmhadm,
icon = icon("hospital"),
color = "fuchsia"
),
),
fluidRow(
valueBox(
subtitle = "Sir Charles Gardiner Hospital Highest Daily Attendance",
value = max_scgatt,
icon = icon("ambulance"),
color = "yellow"
),
valueBox(
subtitle = "Sir Charles Gardiner Hospital Highest Daily Admission",
value = max_scgadm,
icon = icon("hospital"),
color = "yellow"
),
),
fluidRow(
valueBox(
subtitle = "Rockingham Hospital Highest Daily Attendance",
value = max_rghatt,
icon = icon("ambulance"),
color = "teal"
),
valueBox(
subtitle = "Rockingham Hospital Highest Daily Admission",
value = max_rghadm,
icon = icon("hospital"),
color = "teal"
),
),
fluidRow(
valueBox(
subtitle = "Joondalup Health Campus Highest Daily Attendance",
value = max_jhcatt,
icon = icon("ambulance"),
color = "red"
),
valueBox(
subtitle = "Joondalup Health Campus Highest Daily Admission",
value = max_jhcadm,
icon = icon("hospital"),
color = "red"
),
),
fluidRow(
valueBox(
subtitle = "Armadale/Kelmscott Hospital Highest Daily Attendance",
value = max_akdatt,
icon = icon("ambulance"),
color = "orange"
),
valueBox(
subtitle = "Armadale/Kelmscott Hospital Highest Daily Admission",
value = max_akdadm,
icon = icon("hospital"),
color = "orange"
),
),
fluidRow(
valueBox(
subtitle = "Swan District Hospital Highest Daily Attendance",
value = max_sdhatt,
icon = icon("ambulance"),
color = "olive"
),
valueBox(
subtitle = "Swan District Hospital Highest Daily Admission",
value = max_sdhadm,
icon = icon("hospital"),
color = "olive"
),
)
)
ui <- dashboardPage(skin = "purple",
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = body
)
shinyApp(ui, server)

you havent written any server code.
the prototypical template for shiny is


library(shiny)

ui <- fluidPage(
  
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

assuming you loaded library(shiny) , if you then open a new source window and type shinyapp and hit tab this will magically appear. you then fill it in

1 Like

Thanks!
Yes, I did have the library loaded. I had everything working beautifully, all my boxes were displaying and then I saved the file and it stopped... I suppose I will have to retype it all into the template :slight_smile: Thanks again.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.