Challenges Set 5

Instructions

Use the starwars dataset from the dplyr package (loaded already with tidyverse) to complete the below challenges. I highly recommend all of you to first get to know the starwars dataset by trying the “Get to know your data” functions covered at the beginning of the Week 2 Starter file. Good luck and have fun in completing them:

Important

I had to manipulate the original starwars dataset because there were too many categories in some variables. I already run the code below because it is required for you to successfully complete the below challenges. Nonetheless, I wanted to make you aware of the changes made.

Caution

Please note that all the images below have a width optimized to the size of a laptop screen. If your chart looks just slightly different to the one below it could be because they have a different width. Your focus should be in correctly reverse engineering the aesthetics and the geoms. Feel free to open the chart images in a new window or to zoom on them if needed. Best of luck and enjoy these challenges!

Challenge 1:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Challenge 1 chart
Note

Hints:

  • the gold line represent only humans,

  • the purple line species that are not human.

Challenge 2:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Challenge 2 chart
Note

Hints:

  • alpha is 0.3

  • width is 0.25

Challenge 3:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Challenge 3 chart
Note

Hint: colors are purple, gold and green3

Challenge 4:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Challenge 4 chart

Challenge 5:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Challenge 5 chart
Note

Hints:

  • There are three different geoms in this chart.

  • Fill is pink.

  • Colors are pink4 and pink3.

  • Alpha is 0.3; Width is 0.2 and 1.4; shape is 18 and size is 3.

Bonus Challenge 1:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Bonus Chart 1
Note

Hints:

  • Colors are blue, gold and purple.
  • Use labs to add title and change axes names.

Bonus Challenge 2:

Use the starwars dataset and leverage the dataviz skills learned so far to write the code needed to recreate the below chart:

Bonus Chart 2
Note

Hints:

  • For your histogram chart: Put ..density.. on the y axis + change the bars bandwidth to 10 + use lightblue as fill + color as black + alpha to 0.6
  • For your density chart: Change fill to pink + color to pink4 + alpha to 0.4 and size to 0.9.
  • Play with different themes to identify the correct one.

🛑 Don’t Click Submit Just Yet 🚧

Please read carefully the below information:

  • Once you have completed all the coding challenges, and your confident in your work, copy and paste your responses from the chunk into the form fields below each challenge.

  • You are responsible for correctly coping and pasting only the required code to solve each challenge We will grade only what you have submitted!

  • We will only grade 1 submission per student so do not click Submit until you are confident in your responses.

  • By submitting this form you are certifying that you have followed the academic integrity guidelines available in the syllabus. The code and answers submitted are the results of your work and your work only!

  • Make sure you have completed all the challenges and included all the required personal information (e.g., full name, email, zid) in the respective form’s fields. If you don’t know/want to complete a challenge just leave the field below it empty.

  • Now you are ready to click the above “Submit” button. Congrats you have completed this set of challenges!!!