Intro Part 4
Filtering data
Our editor droid J-327D has seen that you can select specific columns (or variables) from our list of characters in the Star Wars world. But now he is curious to see more about his own kind.
J-327D asks if you can list just the droid characters in the data?
starwars |>
filter(species == "Droid")
|>
starwars filter(species == "Droid")
J-327D suggests you check out filter()
function from the tidyverse.
J-327D notes there are a number of functions and operators that are useful when building a filter. He points out a tricky one: ==
tests if both sides of an equation are true. It is sometimes confused with =
, which typically sets a variable name.
JedR challenge
Which droid in the data assumes a “feminine” gender?
You might have to look through your different variable columns to find this answer.
R4-P17 is the only droid listed in the data with a feminine gender.
You’re done with this Trial
Great job you have done! Please inform your JedR Master that you have completed this trial. You are free to attempt the next JedR Trial or continue with JedR Training.