Intro Part 2
Focusing on variables
Now that we know how to glimpse into our data, let’s work on selecting specific variables of interest.
Let’s say the Galactic News Hub has asked you to write a story about height differences across different species. What function would you use to select only the following variables in starwars
: name
, height
, homeworld
, and species
? (Make sure you list your variables in that order!)
Solution
starwars |>
select(name, height, homeworld, species)
|>
starwars select(name, height, homeworld, species)
Hint
J-327D suggests the select()
function, which you can learn about here.
The galaxy is lucky to have someone as strong and brave as you.
Once you’ve completed the exercises above, move to the next part of this trial.