Starwars

starwars
code
analysis
Author

Your Name

Published

October 30, 2023

Let’s analyze the starwars data:

starwars <- read_csv("https://bcdanl.github.io/data/starwars.csv")
rmarkdown::paged_table(starwars) 
ABCDEFGHIJ0123456789
films
<chr>
name
<chr>
species
<chr>
height
<dbl>
mass
<dbl>
hair_color
<chr>
skin_color
<chr>
eye_color
<chr>
birth_year
<dbl>
The Empire Strikes BackLuke SkywalkerHuman17277.0blondfairblue19.0
Revenge of the SithLuke SkywalkerHuman17277.0blondfairblue19.0
Return of the JediLuke SkywalkerHuman17277.0blondfairblue19.0
A New HopeLuke SkywalkerHuman17277.0blondfairblue19.0
The Force AwakensLuke SkywalkerHuman17277.0blondfairblue19.0
The Empire Strikes BackC-3PODroid16775.0NAgoldyellow112.0
Attack of the ClonesC-3PODroid16775.0NAgoldyellow112.0
The Phantom MenaceC-3PODroid16775.0NAgoldyellow112.0
Revenge of the SithC-3PODroid16775.0NAgoldyellow112.0
Return of the JediC-3PODroid16775.0NAgoldyellow112.0

Variable Description for starwars data.frame

The following describes the variables in the starwars data.frame.

  • films List of films the character appeared in

  • name Name of the character

  • species Name of species

  • height Height (cm)

  • mass Weight (kg)

  • hair_color, skin_color, eye_color Hair, skin, and eye colors

  • birth_year Year born (BBY = Before Battle of Yavin)

  • sex The biological sex of the character, namely male, female, hermaphroditic, or none (as in the case for Droids).

  • gender The gender role or gender identity of the character as determined by their personality or the way they were programmed (as in the case for Droids).

  • homeworld Name of homeworld

Human vs. Droid

ggplot(data = 
         starwars %>% 
         filter(species %in% c("Human", "Droid"))) +
  geom_boxplot(aes(x = species, y = mass, 
                   fill = species),
               show.legend = FALSE)