library(tidyverse)
atus_data <- read_rds("https://euclid.nmu.edu/~joshthom/teaching/dat309/week2/ATUS2/ATUS_data.RDS")Mini-Project 1
(now) Due: September 23
In your first project you are to use tools learned this far to explore a real dataset.
Datasets
Use one of these datasets below:
- American Time Use Survey
- Panel Study of Income Dynamics
Required Components
- Use one of the datasets above.
- Submit a .html file rendered via Quarto / Rmarkdown.
- Present your project to class: 3-5 minutes (max!)
- Use
ggplot()with good labels & legendsfilter()select()facet_wrap()orfacet_grid()rename()group_by()&summarize()
- Include the following plots
- barplot
- boxplot
- scatterplot
- Include a brief summary and conclusion.
- Include a brief discussion each of your plots. Two-three sentences should suffice.
Tips
- Create an R-script to do your exploratory work.
- Comment well.
- After you have some good plots and/or statistics, copy your work into the .qmd file.
- Remember, your
markdownenvironment is different than your console, so you will have to load the data/tidyverse again.
- This page sheds light on the haven package we’re using with the ATUS data. Two tools that might be useful:
library(tidyverse)
library(janitor)
df <- read_rds("https://euclid.nmu.edu/~joshthom/teaching/dat309/week2/ATUS2/ATUS_data.RDS") |> clean_names()
# make the hvn+lbl a factor
new_atus <- df |> mutate(sex = haven::as_factor(sex))
# use the number part of the hvn+lbl variable
new_atus <- new_atus |> mutate(sex = haven::zap_labels(sex))library(tidyverse)
atus_data <- read_rds("https://euclid.nmu.edu/~joshthom/teaching/dat309/week2/ATUS2/ATUS_data.RDS")
# filter(data, )