pop_race_2019 {usdata} | R Documentation |
Population Race 2019 Data.
Description
State level data on population by race.
Usage
pop_race_2019
Format
A data frame with 2820 rows and 4 variables.
- state
State as 2 letter abbreviation.
- state_name
State name.
- race
race cohort for population.
- hispanic
indicates whether population is Hispanic or Latino
- population
Population of race cohort.
- state_total_population
total estimated state population in 2019
Source
Centers for Disease Control and Prevention
Examples
library(dplyr)
# List race population for each state with percent of total
pop_race_2019 |>
group_by(state_name, race, hispanic) |>
mutate(percent = population / state_total_population * 100) |>
select(state_name, race, hispanic, population, percent)
pop_race_2019 |>
select(state_name, state_total_population) |>
distinct() |>
arrange(desc(state_total_population))
[Package usdata version 0.3.1 Index]