Strings

Author

Jeffrey R. Stevens

Published

March 8, 2023

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

  1. Load tidyverse and import dog_breed_traits_clean.csv to traits.
# >
  1. Return the first ten letters of the alphabet in upper case.
# >
  1. Create this character string and assign it to mystring: The elephant said “Hello” then ‘Bye!’ Then view how it would be printed.
# >
  1. Find how many characters are in mystring.
# >
  1. Create a vector of the first four characters of the coat_length column from traits.
# >
  1. Convert the breed column of traits to sentence case.
# >
  1. Create series of sentences using breed and coat_length that states “[insert breed name] have a [insert coat length] coat” that uses the proper cases.
# >
  1. In the mtcars data set, extract the first two digits of the mpg variable and the last three digits of the car names and combine them into a single string.
# >
  1. Print the fruit data set, then capitalize all first word letters in the data set, then capitalize all words in the data set.
# >