Я все еще учусь, и мне это не по душе. У меня есть панель с полями значений, в которой я извлекаю максимальные значения из набора данных, в котором есть 9 больниц, и посещаемость ER в сравнении с показателями приема. как и где в коде добавить линейчатую диаграмму, показывающую показатели посещаемости, наложенные линией, показывающей показатели приема? Конструктивная обратная связь приветствуется!
Код:
library("shiny")
library(shiny)
library(shinydashboard)
library(bootstrap)
library(dplyr)
library("leaflet")
library(ggplot2)
max_rphatt <- max(WA_Health$rphatt, na.rm = TRUE)
max_rphadm <- max(WA_Health$rphadm, na.rm = TRUE)
max_rphtat <- max(WA_Health$rphtat, na.rm = TRUE)
max_rphtot <- max(WA_Health$rphtot, na.rm = TRUE)
max_fhatt <- max(WA_Health$fhatt, na.rm = TRUE)
max_fhadm <- max(WA_Health$fhadm, na.rm = TRUE)
max_fhtat <- max(WA_Health$fhtat, na.rm = TRUE)
max_fhtot <- max(WA_Health$fhtot, na.rm = TRUE)
max_pmhatt <- max(WA_Health$pmhatt, na.rm = TRUE)
max_pmhadm <- max(WA_Health$pmhadm, na.rm = TRUE)
max_pmhtat <- max(WA_Health$pmhtat, na.rm = TRUE)
max_pmhtot <- max(WA_Health$pmhtot, na.rm = TRUE)
max_kematt <- max(WA_Health$kematt, na.rm = TRUE)
max_kemadm <- max(WA_Health$kemadm, na.rm = TRUE)
max_kemtat <- max(WA_Health$kemtat, na.rm = TRUE)
max_kemtot <- max(WA_Health$kemtot, na.rm = TRUE)
max_scgatt <- max(WA_Health$scgatt, na.rm = TRUE)
max_scgadm <- max(WA_Health$scgadm, na.rm = TRUE)
max_scgtat <- max(WA_Health$scgtat, na.rm = TRUE)
max_scgtot <- max(WA_Health$scgtot, na.rm = TRUE)
max_jhcatt <- max(WA_Health$jhcatt, na.rm = TRUE)
max_jhcadm <- max(WA_Health$jhcadm, na.rm = TRUE)
max_jhctat <- max(WA_Health$jhctat, na.rm = TRUE)
max_jhctot <- max(WA_Health$jhctot, na.rm = TRUE)
max_rghatt <- max(WA_Health$rghatt, na.rm = TRUE)
max_rghadm <- max(WA_Health$rghadm, na.rm = TRUE)
max_rghtat <- max(WA_Health$rghtat, na.rm = TRUE)
max_rghtot <- max(WA_Health$rghtot, na.rm = TRUE)
max_sdhatt <- max(WA_Health$sdhatt, na.rm = TRUE)
max_sdhadm <- max(WA_Health$sdhadm, na.rm = TRUE)
max_sdhtat <- max(WA_Health$sdhtat, na.rm = TRUE)
max_sdhtot <- max(WA_Health$sdhtot, na.rm = TRUE)
max_akdatt <- max(WA_Health$akdatt, na.rm = TRUE)
max_akdadm <- max(WA_Health$akdadm, na.rm = TRUE)
max_akdtat <- max(WA_Health$akdtat, na.rm = TRUE)
max_akdtot <- max(WA_Health$akdtot, na.rm = TRUE)
body <- dashboardBody(
titlePanel("WA Health Hospital Emergency Room Admissions"),
fluidRow(
valueBox(
subtitle = "Royal Perth Hospital Attendance",
value = max_rphtat,
icon = icon("stethoscope"),
color = "green",
width = 3,
),
valueBox(
subtitle = "Royal Perth Hospital ER Admissions",
value = max_rphtot,
icon = icon("bed"),
color = "green",
width = 3,
),
valueBox(
subtitle = "King Edward Hospital Attendance",
value = max_kemtat,
icon = icon("stethoscope"),
color = "aqua",
width = 3,
),
valueBox(
subtitle = "King Edward Hospital ER Admissions",
value = max_kemtot,
icon = icon("bed"),
color = "aqua",
width = 3,
),
),
fluidRow(
valueBox(
subtitle = "Fremantle District Hospital Attendance",
value = max_fhtat,
icon = icon("stethescope"),
color = "blue",
width = 3,
),
valueBox(
subtitle = "Fremantle Hospital ER Admissions",
value = max_fhtot,
icon = icon("bed"),
color = "blue",
width = 3,
),
valueBox(
subtitle = "Princess Margaret Hospital Attendance",
value = max_pmhtat,
icon = icon("stehoscope"),
color = "fuchsia",
width = 3,
),
valueBox(
subtitle = "Princess Margaret Hospital ER Admissions",
value = max_pmhtot,
icon = icon("bed"),
color = "fuchsia",
width = 3,
),
),
fluidRow(
valueBox(
subtitle = "Sir Charles Gardiner Hospital Attendance",
value = max_scgtat,
icon = icon("ambulance"),
color = "yellow",
width = 3,
),
valueBox(
subtitle = "Sir Charles Gardiner Hospital ERAdmissions",
value = max_scgtot,
icon = icon("bed"),
color = "yellow",
width = 3,
),
valueBox(
subtitle = "Rockingham Hospital Attendance",
value = max_rghtat,
icon = icon("ambulance"),
color = "teal",
width = 3,
),
valueBox(
subtitle = "Rockingham Hospital ER Admissions",
value = max_rghtot,
icon = icon("bed"),
color = "teal",
width = 3,
),
),
fluidRow(
valueBox(
subtitle = "Joondalup Health Campus Attendance",
value = max_jhctat,
icon = icon("stethoscope"),
color = "red",
width = 3,
),
valueBox(
subtitle = "Joondalup Health Campus ER Admissions",
value = max_jhctot,
icon = icon("bed"),
color = "red",
width = 3,
),
valueBox(
subtitle = "Armadale/Kelmscott Hospital Attendance",
value = max_akdtat,
icon = icon("stethoscope"),
color = "orange",
width = 3,
),
valueBox(
subtitle = "Armadale/Kelmscott Hospital ER Admissions",
value = max_akdtot,
icon = icon("bed"),
color = "orange",
width = 3,
),
),
fluidRow(
valueBox(
subtitle = "Swan District Hospital Attendance",
value = max_sdhtat,
icon = icon("stethoscope"),
color = "olive",
width = 3,
),
valueBox(
subtitle = "Swan District Hospital ER Admissions",
value = max_sdhtot,
icon = icon("bed"),
color = "olive",
width = 3,
),
)
)
ui <- dashboardPage(
header = dashboardHeader(title = "WA Health 2013"
),
skin = "purple",
sidebar = dashboardSidebar(),
body = body
)
server <- function(input, output, session) {
}
shinyApp(ui, server)