data_set_week/scripts/dream_acs12.R

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()
npaterno/data_hunter documentation built on July 22, 2022, 10:20 a.m.