Lars Schöbitz
Global Health Engineering - ETH Zurich
2022-05-12
Learners can apply ten functions from the
dplyr
R Package to generate a subset of data for use in a table or plot
… based on the concepts of functions as verbs that manipulate data frames
select
: pick columns by namearrange
: reorder rowsslice
: chooses rows based on locationfilter
: pick rows matching criteriarelocate
: changes the order of the columnsmutate
: add new variablessummarise
: reduce variables to valuesgroup_by
: for grouped operationsRules of dplyr
functions:
Rows: 87
Columns: 14
$ name <chr> "Luke Skywalker", "C-3PO", "R2-D2", "Darth V…
$ height <int> 172, 167, 96, 202, 150, 178, 165, 97, 183, 1…
$ mass <dbl> 77.0, 75.0, 32.0, 136.0, 49.0, 120.0, 75.0, …
$ hair_color <chr> "blond", NA, NA, "none", "brown", "brown, gr…
$ skin_color <chr> "fair", "gold", "white, blue", "white", "lig…
$ eye_color <chr> "blue", "yellow", "red", "yellow", "brown", …
$ birth_year <dbl> 19.0, 112.0, 33.0, 41.9, 19.0, 52.0, 47.0, N…
$ sex <chr> "male", "none", "none", "male", "female", "m…
$ gender <chr> "masculine", "masculine", "masculine", "masc…
$ homeworld <chr> "Tatooine", "Tatooine", "Naboo", "Tatooine",…
$ species <chr> "Human", "Droid", "Droid", "Human", "Human",…
$ films <list> <"The Empire Strikes Back", "Revenge of the…
$ vehicles <list> <"Snowspeeder", "Imperial Speeder Bike">, <…
$ starships <list> <"X-wing", "Imperial shuttle">, <>, <>, "TI…
ae-12-data-transformation-dplyr
ae-12a-dplyr.qmd
15:00
10:00
ae-12b-dplyr.qmd
Slides created via revealjs and Quarto: https://quarto.org/docs/presentations/revealjs/ Access slides as PDF on GitHub
All material is licensed under Creative Commons Attribution Share Alike 4.0 International.