library(ggplot2)
library(dplyr)
library(openintro)
View(dream)
plot_data <- dream %>%
count(ideology, stance)
ggplot(plot_data, aes(ideology, n, fill = ideology))+
geom_col(position = "dodge") +
facet_wrap(~stance) +
theme_minimal() +
theme(axis.text.x = element_blank()) +
labs(
title = "Ideology versus support for the DREAM Act",
fill = "Ideology",
x = "",
y = "Count"
) +
scale_fill_openintro("three")
ggplot(acs12, aes(employment)) +
geom_bar(fill = IMSCOL["green", "full"]) +
theme_minimal() +
labs(
title = "Employment status",
x = "",
y = "count"
)
ggplot(acs12, aes(hrs_work)) +
geom_histogram(binwidth = 10, color = "white", fill = IMSCOL["blue", "full"]) +
theme_minimal() +
labs(
title = "Hours worked in 2020 for American Community Survey",
x = "Hours Worked (per week)",
y = "Count"
)
ggplot(acs12, aes(age)) +
geom_histogram(binwidth = 10, color = "white", fill = IMSCOL["blue", "full"]) +
labs(
title = "Age of respondents for American Community Survey",
x = "Age",
y = "Count"
) +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.