b. Use ggplot to get a visualization of "species* colored by house. What are your conclusions? ggplot(df,aes(x=col) b. Use ggplot to get a visualization of ancestry colored by whether the character is alive or dead. What are your conclusions? {r} 2. Text basics. a. Make a "single* string called "veggies" which consists of your 3 favorite vegetables, and (programmatically in R) count the number of characters in that string. Also make a "single*-stre called "fruits" which consists of your 3 favorite fruits. Display both your strings, results from when you counted characters. How many characters are in each string? results b. Now make a vector of length 2 called "VeggiesandFruits", consisting of two strings, "veggies* (as above) in the first component, and "fruits* in the second component. Then (programmatically) count the number of characters in each. i. What R command will display only the fruit entry of VeggiesandFruits? ii. What R command will display only 1 st fruit entry of VeggiesandFruits? c. Use "paste" to combine the two entries of VeggiesandFruits, separated by \#\#\#, into a single string, and call the resulting string "veggiesandfruits pond". Count the number of characters in "veggiesandfruits pound*. d. Display the last 6 letters from the "veggiesandfruits pound" string. {r} e. Display the first 4 letters from each of the strings in the vector "VeggiesandFruits* {r} 2. Splitting and combining strings a. Split the "veggies* string into three strings, the first and second and third favorites. Save the resulting as "veggies.list*, and display it. Verify using R cormands that veggies.list is in fact a list. Show how you access your second favorite veggie in this list. 61 b. Now use a single R command to split the "Veggiesandfruits" vector into a list of two elements, with each entry containing three strings. Show how you access your second favorite fruit in this list. 62 63 . {r} 64 65 66 67 67 3. Revisit the "harry* dataset that I've posted on Moodle. 68 69 a. Use "which* to find all Harry Potter characters that were in Griffindor or Slytherin. Create a dataframe that contains those characters. Display the head of the resulting dataframe. 70 71 . {r} 72 73= 74 b. Use R commands to decide how many characters are from Griffindor? How many are from Slytherin? 75 76={r} 3. Revisit the "harry" dataset that I've posted on Moodle. a. Use *which* to find all Harry Potter characters that were in Griffindor or Slytherin. Create dataframe that contains those characters. Display the head of the resulting dataframe. {r} b. Use R commands to decide how many characters are from Griffindor? How many are from Stytherin? {r} c. Use R commands to find all Harry Potter characters have unicorn hair in their wand cores. Do these characters have anything more in comon? 81+{ 82 83= 84 85 10:7 G Chunk 1