R Bootcamp - Day 3 - Exercises

Author

Jay Hesselberth

Published

September 6, 2025

Today’s datasets - Exercise 1

Explore these data sets:

arrange - Exercise 2

filter - Exercise 3

filter by membership

# filter based on skin color

Conditions can be combined using & (and), | (or).

# filter on skin and eye color

select - Exercise 4

mutate (& pipe |>)- Exercise 5

# create a new column to display height in meters

# using the pipe to feed data into multiple functions sequentially

# mutate allows you to refer to columns that you’ve just created

# output needs to be saved into a new dataframe since dplyr does not "change" the original dataframe

# using if_else clauses with mutate

case_when - Exercise 6

# create categories based on height
# multiple conditions with case_when

summarise - Exercise 7

group_by + summarize - Exercise 8

# multiple grouping variables

across - Exercise 9

# apply mean to multiple columns
# apply multiple functions with list()
# combine across() with group_by()