ggplot(data = cd_dia_ustotal, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - US Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2015") +
theme_light()
ggplot(data = cd_dia_seattle, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - Seattle", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2015") +
theme_light()
## Warning: Removed 4 rows containing missing values (geom_point).
ggplot(data = cd_dia_sanjose, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - San Jose", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2011-2013") +
theme_light()
ggplot(data = cd_dia_sanant, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - San Antonio", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2016") +
theme_light()
## Warning: Removed 6 rows containing missing values (geom_point).
ggplot(data = cd_dia_portland, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - Portland", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2015") +
theme_light()
## Warning: Removed 6 rows containing missing values (geom_point).
ggplot(data = cd_dia_indi, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - Indianapolis", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2015") +
theme_light()
ggplot(data = cd_dia_bos, mapping = aes(x= Year, y = Value, color = Race, shape = Sex)) +
geom_point () +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - Boston", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "Diabetes Mortality Rate", caption = "Data includes 2010-2013") +
theme_light()
You can also embed plots, for example:
## Warning: Removed 12 rows containing missing values (geom_point).
cd_dia_b1 <- ggplot(subset(cd_dia, Race=="Black")) +
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 (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2016") +
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 (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
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 (Race = Hispanic)", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_light()
cd_dia_h11 <- ggplotly(cd_dia_h1)
cd_dia_h11
ggplot(subset(cd_dia_ustotal, Race=="Black")) +
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 (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_minimal()
ggplot(subset(cd_dia_ustotal, 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 (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_minimal()
ggplot(subset(cd_dia_ustotal, Race=="Hispanic")) +
geom_point (mapping = aes(x= Year, y = Value, color = Place)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate (Race = Hispanic)", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_minimal()
ggplot(subset(cd_dia_ustotal, Race=="Asian/PI")) +
geom_point (mapping = aes(x= Year, y = Value, color = Place)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate (Race = Asian/PI)", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_minimal()
ggplot(subset(cd_dia_ustotal, Race=="All")) +
geom_point (mapping = aes(x= Year, y = Value, color = Place, shape = Sex)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate (Race = All)", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_minimal()
##Imp code chunk
ggplot(data = cd_dia_ustotal) +
geom_point (mapping = aes(x= Year, y = Value, color = Sex, shape = Sex)) +
facet_wrap(facets = vars(Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - U.S. Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_light()
#ggplot(data = cd_dia) +
# geom_point (mapping = aes(x= Year, y = Value, color = Sex, shape = Sex)) +
# facet_wrap(facets = vars(Race)) +
# labs(title = "Chronic Disease - Diabetes Mortality Rate - U.S. Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
#theme_light()
#ggplot(data = cd_dia_imp) +
# geom_point (mapping = aes(x= Year, y = Value, color = Sex, shape = Sex)) +
# facet_wrap(facets = vars(Sex)) +
# labs(title = "Chronic Disease - Diabetes Mortality Rate - U.S. Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
#theme_light()
cd_dia_allrace_1 <-ggplot(data = cd_dia_allrace) +
geom_point (mapping = aes(x= Year, y = Value, color = Place, shape = Sex)) +
facet_wrap(facets = vars(Sex)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - U.S. Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_light()
cd_dia_allrace_11 <- ggplotly(cd_dia_allrace_1)
cd_dia_allrace_11
cd_dia_imp_1 <-ggplot(data = cd_dia_bos) +
geom_point (mapping = aes(x= Year, y = Value, color = Place)) +
facet_grid(rows = vars(Sex), cols = vars (Race)) +
labs(title = "Chronic Disease - Diabetes Mortality Rate - U.S. Total", subtitle = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", x = "Year", y = "(Diabetes Mortality Rate (Age-Adjusted; Per 100,000 people))", caption = "Data includes 2010-2015") +
theme_light()
cd_dia_imp_11 <- ggplotly(cd_dia_imp_1)
cd_dia_imp_11
Note that the echo = FALSE
parameter was added to the code chunk to prevent printing of the R code that generated the plot.