library(tidyverse)
library(ggthemes)
library(socviz)
library(ggrepel)
# Setting a default ggplot theme
theme_set(theme_fivethirtyeight() +
theme(strip.background = element_rect(fill="lightgray"),
axis.title.x =
element_text(angle = 0,
size = rel(1.33),
margin = margin(10,0,0,0)),
axis.title.y =
element_text(angle = 90,
size = rel(1.33),
margin = margin(0,10,0,0))
) )
Classwork 5
Graph Tables; Add Labels; Make Notes
Recreate the R code necessary to generate the following graphs.
Question 1
<- socviz::gss_sm
gss_sm
::datatable(gss_sm) # displaying an interactive data.frame DT
Question 2
<- socviz::organdata
organdata
::datatable(organdata) DT
Q2a
Q2b
Q2c
Q2d
Q2e
Q2f
Q2g
Question 3
<- datasets::mtcars
mtcars <- mtcars %>% # A native pipe (|>) does not work here.
mtcars mutate(car = rownames(.))
rownames(mtcars) <- 1:nrow(mtcars)
::datatable(mtcars) DT
Discussion
Welcome to our Classwork 5 Discussion Board! 👋
This space is designed for you to engage with your classmates about the material covered in Classwork 5.
Whether you are looking to delve deeper into the content, share insights, or have questions about the content, this is the perfect place for you.
If you have any specific questions for Byeong-Hak (@bcdanl) regarding the Classwork 5 materials or need clarification on any points, don’t hesitate to ask here.
All comments will be stored here.
Let’s collaborate and learn from each other!