Skip to content

Instantly share code, notes, and snippets.

@tommyhuang1
Created February 5, 2017 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommyhuang1/15a16f8dea0ea32352b7b23a3f4db32b to your computer and use it in GitHub Desktop.
Save tommyhuang1/15a16f8dea0ea32352b7b23a3f4db32b to your computer and use it in GitHub Desktop.
#ui.R
menuSubItem("Heart Disease and Stroke Indicators",tabName = "HeartDiseaseandStrokeIndicators",icon = icon("bar-chart"))
tabItem(tabName = "HeartDiseaseandStrokeIndicators",
h3("Heart Disease and Stroke Mortality"),
fluidRow(column(12,plotOutput("HeartDiseaseStrokeMortality"))),
br(),
h3("Heart Disease and Stroke Hospitalizations"),
fluidRow(column(12,plotOutput("HeartDiseaseStrokeHospitalizations"))))
#server.R
output$HeartDiseaseStrokeMortality<-renderPlot(
ggplot(HD1,aes(x=factor(Race_Ethnicity),y=Mortality)) + facet_wrap(~MortalityType) +
geom_bar(stat="identity",aes(fill = factor(Race_Ethnicity))) + guides(fill=guide_legend(title = "Race Ethnicity")) +
theme(strip.text = element_text(size=15)) + xlab('Race Ethnicity') + ylab('Mortality per 100,000 Population') +
theme(plot.title = element_text(size = 15, face = "bold"))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment