R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

ggplot(subset(cd_ast, Year==2010)) + 
  geom_point (mapping = aes(x= Race, y = Value, color = Race))

ggplot(subset(cd_ast, Place == "Las Vegas (Clark County), NV")) + 
  geom_point (mapping = aes(x= Race, y = Value, color = Race))

ggplot(subset(cd_ast, Year==2010 | Place=="Boston, MA")) + 
  geom_point (mapping = aes(x= Race, y = Value, color = Race))
## Warning: Removed 1 rows containing missing values (geom_point).

##Most Imp Code chunk for Races - Chronic Disease - Asthma
cd_ast_b1 <- ggplot(subset(cd_ast, Race=="Black")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))  + 
  labs(title = "Chronic Disease - Asthma (Race = Black)", subtitle = "(Asthma Emergency Department Visit Rate (Age-Adjusted; Per 10,000))", x = "Year", y = "Asthma Emergency Department Visit Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_ast_b11 <- ggplotly(cd_ast_b1)
cd_ast_b11
cd_ast_w1 <- ggplot(subset(cd_ast, Race=="White")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))+ 
  labs(title = "Chronic Disease - Asthma (Race = White)", subtitle = "(Asthma Emergency Department Visit Rate (Age-Adjusted; Per 10,000))", x = "Year", y = "Asthma Emergency Department Visit Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_ast_w11 <- ggplotly(cd_ast_w1)
cd_ast_w11
cd_ast_h1 <- ggplot(subset(cd_ast, Race=="Hispanic")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))+ 
  labs(title = "Chronic Disease - Asthma (Race = Hispanic)", subtitle = "(Asthma Emergency Department Visit Rate (Age-Adjusted; Per 10,000))", x = "Year", y = "Asthma Emergency Department Visit Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_ast_h11 <- ggplotly(cd_ast_h1)
cd_ast_h11
cd_ast_a1 <- ggplot(subset(cd_ast, Race=="Asian/PI")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))
cd_ast_a11 <- ggplotly(cd_ast_a1)
cd_ast_a11
#ggplot(data=cd_ast) +
 # geom_point (mapping = aes(x= Year, y = Value, size = Race, color = Race)) +
  #labs(title = "All-Cause Mortality Rate for Las Vegas", subtitle = "(Age-Adjusted; Per 100,000 people)", x = "Year", y = "Mortality Rate", caption = "Data includes 2010-215") +
  #theme_minimal()
#cd_dia <- read_xlsx("/Users/na/Desktop/Shri R Projects/Grad695 Prject/Data Feb2020/Chronic Disease.xlsx", sheet = 9)
cd_dia_b1 <- ggplot(subset(cd_dia, Race=="Black" | Value > 40)) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))  + 
  labs(title = "Chronic Disease - Diabetes Mortality Rate (Race = Black)", subtitle = "Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people)", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2015") +
  theme_minimal()
cd_dia_b11 <- ggplotly(cd_dia_b1)
cd_dia_b11
cd_dia_w1 <- ggplot(subset(cd_dia, Race=="White")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))+ 
labs(title = "Chronic Disease - Diabetes Mortality Rate (Race = White)", subtitle = "Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people)", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_dia_w11 <- ggplotly(cd_dia_w1)
cd_dia_w11
cd_dia_h1 <- ggplot(subset(cd_dia, Race=="Hispanic")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place))+ 
labs(title = "Chronic Disease - Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people) (Race = Hispanic)", subtitle = "Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people)", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_dia_h11 <- ggplotly(cd_dia_h1)
cd_dia_h11
cd_dia_a1 <- ggplot(subset(cd_dia, Race=="Asian/PI")) + 
  geom_point (mapping = aes(x= Year, y = Value, color = Place)) +
  labs(title = "Chronic Disease - Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people) (Race = Asian/PI)", subtitle = "Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people)", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-215") +
  theme_minimal()
cd_dia_a11 <- ggplotly(cd_dia_a1)
cd_dia_a11

Including Plots

You can also embed plots, for example: