R Bootcamp Problem Set 6

Author

Your name here

Published

September 25, 2026

Problem Set

Use the data files in the data/ directory to answer the questions.

For this problem set, you are allowed to help each other, but you are not allowed to post correct answers in slack.

Grading rubric

  • Everything is good: full points
  • Partially correct answer: depends on how many steps are correct
  • Reasonable attempt: half points

Libraries

Load the libraries you need for analysis below.

Question 1 - 5 points

Run the following chunk:

set.seed(42)
x <- sample(1000, replace = TRUE)

Now use logical indexing to find the number of values > 450 in x.

Question 2 - 5 points

Count the number of species in the penguins tibble using forcats::fct_count()

Count number of island + sex combinations using dplyr::count(), and sort the result by count.

Question 3 - 5 points

Use stringr::str_c() to combine upper and lowercase letters from letters and LETTERS with a slash.

Your answer should look like: "A/a" "B/b" "C/c" etc.

Use stringr::str_split() or one of its variants to split up the strings you made above and extract the letter after the slash.

Question 4 - 5 points

Create a ggplot using the diamonds data set.

Submit