Problem 0 (optional, ungraded)

Complete the DataCamp course Data Visualization with ggplot2 (Part 1). You may benefit from completing all five chapters in the course.

Problem 1

The characters in the 1977 interstellar space movie A New Hope come from different planets. We are interested in comparing their physical dimensions.

The following code will generate a data frame of information about these characters.

library(tidyverse)
a_new_hope <- starwars %>%
  filter(
    mass < 1000, 
    grepl("A New Hope", films)
  )

Use ggplot2 and the data frame a_new_hope to make the following plot:

You may find it helpful to consult the documentation for the labs() function from ggplot2.

Problem 2

Use the ggrepel package to update your plot with labels for names of the characters.


Grading Rubric

There are 10 possible points on this assignment.

Baseline (C level work)
  • +4 for completing the assignment on time
  • +3 for an .Rmd that compiles without errors
Average (B level work)
  • +1 unnecessary messages from R are hidden from being displayed in the HTML
  • +1 producing a reasonably close facsimile of the data graphic in Problem 1
Advanced (A level work)
  • +1 for completing Problem 2