-
-
Save tommyhuang1/dcfe0d3e9f98c721d5d92aa8c37bbe54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ui.R | |
menuSubItem("Substance Abuse/Mental Health-Related Indicators",tabName = "SubstanceAbuseMentalHealthIndicators",icon = icon("bar-chart")) | |
tabItem(tabName = "SubstanceAbuseMentalHealthIndicators", | |
h3("Substance Abuse Mental Health Mortality"), | |
fluidRow(column(12,plotOutput("DrugSuicideMortality"))), | |
br(), | |
h3("Substance Abuse Mental Health Hospitalizations"), | |
fluidRow(column(12,plotOutput("DrugRelatedHospitalizations")))) | |
#server.R | |
output$DrugSuicideMortality<-renderPlot( | |
ggplot(SAM1,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