Take-home Exercise 1

A new article created using the Distill format.

Chu Yi Ning https://www.linkedin.com/public-profile/settings?trk=d_flagship3_profile_self_view_public_profile (SMU SCIS)https://scis.smu.edu.sg/
2022-04-24

Overview

In this take-home exercise

Getting Started

packages = c('tidyverse', 'ggdist', 'ggridges',
             'patchwork', 'ggthemes', 'hrbrthemes',
             'ggrepel', 'ggforce')
for(p in packages){
  if(!require(p, character.only = T)){
    install.packages(p)
  }
  library(p, character.only = T)
}

Importing Data

part_data <- read_csv("data/Participants.csv")

A Simple Bar Chart

ggplot(data=part_data, 
       aes(x=educationLevel)) +
  geom_bar()

ggplot(data=part_data, 
       aes(x=householdSize)) +
  geom_bar()

ggplot(data=part_data, 
             aes(x = age)) +
  geom_histogram(bins=20, 
                 boundary = 100,
                 color="grey25", 
                 fill="grey90") +
  ggtitle("Distribution of age") +
  theme_economist()

ggplot(data=part_data,
aes(y = joviality, x= haveKids)) +
geom_boxplot()

Distill is a publication format for scientific and technical writing, native to the web.

Learn more about using Distill for R Markdown at https://rstudio.github.io/distill.