# >Pivoting data
For these exercises, we’ll use a new clean version of the dog breed traits data set.
- Import data from https://jeffreyrstevens.quarto.pub/dpavir/data/dog_breed_traits_clean.csv and assign to
traits.
- Create
traits2where we delete the coat columns, so we only have breed and ratings data.
# >Is
traits2tidy?Is
traits2in wide or long format?Reshape
traits2so that all of the ratings scores are in a single column called rating with a column labeling what kind of rating it is called scale. Assign this totraits3.
# >How would we check if
traits3has the expected number of rows?Create
traits4by removing the rows with affectionate, children, and other_dogs as values of scale.
# >- Spread out the data into wide format with separate columns for the shedding and grooming data, then create a new column diff that subtracts grooming from shedding ratings.
# >