Challenge 5 - Adithya Parupudi

challenge_5
ggplot
australian_marriage
Introduction to Visualization
Author

Adithya Parupudi

Published

August 22, 2022

library(tidyverse)
library(ggplot2)
library(summarytools)

knitr::opts_chunk$set(echo = TRUE, warning=FALSE, message=FALSE)

Read in data

We are choosing the australian marriages dataset

australia <- read_csv('_data/australian_marriage_tidy.csv')

Briefly describe the data

Tidy Data (as needed)

Dataset is already tidy

head(australia)
# A tibble: 6 × 4
  territory       resp    count percent
  <chr>           <chr>   <dbl>   <dbl>
1 New South Wales yes   2374362    57.8
2 New South Wales no    1736838    42.2
3 Victoria        yes   2145629    64.9
4 Victoria        no    1161098    35.1
5 Queensland      yes   1487060    60.7
6 Queensland      no     961015    39.3

Univariate Visualizations

This is plotted against count vs percent, which is grouped by territory

australia %>% 
  group_by(territory) %>% 
  ggplot(aes(count,percent, color=resp)) +
  geom_point(size=2,alpha=0.5) +
  geom_line(color='black') +
  facet_wrap(~resp, nrow=1) +
  labs(title='Australian Marriages') +
  theme_bw()

Bivariate Visualization(s)

NA