knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of HealthIneq is to shed light on the health inequities across the United States.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("elachtara/HealthIneq")
First you will load the package and call for the data.
library(HealthIneq) library(dplyr) data("HealthIneq")
Let's look at the life expectancy for males vs. females:
# Create average life expectancy across all counties HealthIneq %>% summarize(male_avg = mean(avglifeM), female_avg = mean(avglifeF))
Looks like females live on average over 3 years longer than males.
Let's make a plot of these life expectancies.
plot(HealthIneq$avglifeM, HealthIneq$avglifeF, main = "Male vs. Female Life Expectancies", xlab = "Male Life Expectancy (Years)", ylab = "Feale Life Expectancy (Years)")
There appears to be a linear relationship between male and female life expectancies across the counties of the United States. Check out the vignette for more examples on how to use the package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.