Factors

Author

Jeffrey R. Stevens

Published

March 20, 2023

For these exercises, we’ll use the dog breed traits data set.

  1. Load tidyverse, import dog_breed_traits_clean.csv to traits.
# >
  1. Convert both coat_type and coat_length into factors using across() and save as traits2.
# >
  1. Check the levels for both columns, one using a pipe and one without using a pipe.
# >
  1. Reorder the levels for coat_length to be Short, Medium, Long (reassigned to traits2) and then check the levels.
# >
  1. Reorder the levels for coat_type to be in the order of the most to least frequent coat type and then check the levels.
# >
  1. Relabel coat_length to be Stubby, Mid, and Lush rather than Short, Medium, and Long.
# >
  1. The new AKC standard subsumes Rough coats with Wiry coats and Silky with Wavy. Please update the coat_type variable accordingly.
# >