View source: R/get_congressional_demographics.R
visualize_df_by_race_ethnicity_party | R Documentation |
Requires a data.frame with specific column names. In practice, the data.frame is expected to come from a function like ?get_congressional_districts and then merged with a data.frame that has column "party".
visualize_df_by_race_ethnicity_party(df)
df |
A data.frame with columns "party", "percent_white", "percent_black", "percent_asian", "percent_hispanic" |
data("df_congress116_demographics")
data("df_congress116_party")
df = merge(df_congress116_demographics, df_congress116_party)
# Race and Ethnicity of the 116th Congressional Districts using data from
# the 2018 5-year American Community Survey
visualize_df_by_race_ethnicity_party(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.