Appex 04
STA 112 - Fall 2023
Part 1
- Create a new project using my template here:
https://github.com/sta-112-f23/appex-04-starwars.git
- Run the R chunk labeled
"load-packages"
- Take a look at the
starwars
data
Part 2
In the Console, use filter()
and logical tests to show…
- The data for Humans
- The data for characters with a homeworld Alderaan
- Rows where the mass is greater than 1000
Part 3
Create a new R chunk in your .qmd file. Use filter()
and Boolean logical tests to show…
- Droids more than 70 kg
- Characters that are born before 56 and have blue eyes
- Characters that are born before 56 and have blue eyes and are not Human
Part 4
Create a new R chunk in your .qmd file. Use mutate()
to
- Add a
droid
column that isTRUE
if the species is a Droid - Add a column for the logged weight (hint: use
log()
) - Add a
human_droid
column that says “Human or Droid” if the character is a human or a droid and “Not Human or Droid” if it’s not
Part 5
Create a new R chunk in your .qmd file. Use summarize()
to calculate…
- The first (minimum) birth year in the dataset
- The last (maximum) birth year in the dataset
- The number of distinct homeworlds in the dataset (use the cheatsheet)
Part 6
Create a new R chunk in your .qmd file. Use filter()
and summarize()
to calculate
- The number of unique homeworlds and
- The median height for characters from Tatooine born before the year 100
Part 7
Create a new R chunk in your .qmd file.
- Find the minimum, maximum, and median mass for each species
- Find the minimum, maximum, and median mass for each species from Tatooine