class: middle, right, title-slide .title[ # Introduction to Tidyverse ] .author[ ### Athanasia Monika Mowinckel ] --- layout: true <div class="my-sidebar"></div> --- ## Timeline - **Introduction to [tidyverse](https://www.tidyverse.org/) concepts** (15 minutes) -- - **Tidy data wrangling** - with translations to base-R (~ 2 hours) - plotting data with [ggplot2](https://ggplot2.tidyverse.org/) (~25 min) - sub-setting data with [dplyr](https://dplyr.tidyverse.org/) (~25 min) - chaining commands with the pipe `|>` (~10 min) - adding and altering variables with [dplyr](https://dplyr.tidyverse.org/) (~25 min) -- - **Lunch break** (30 min) -- - **Tidy data reshaping & summaries** - avoiding loops (~ 1.5 hours) - pivoting data with [tidyr](https://tidyr.tidyverse.org/) (~25 min) - grouped summaries with [dplyr](https://dplyr.tidyverse.org/) (~25 min) - working with nested data using [purrr](https://purrr.tidyverse.org/) (~25 min) -- > All parts (except first intro) come with small exercises and breaks between. --- class: dark, center, middle # What is the Tidyverse? --- background-image: url(img/tidyverse_2020-08-28.png) background-size: cover --- background-image: url(img/hex_yes.png) background-size: 15% background-position: 37% 20% ## The packages .pull-left[ ### Covered here |Package|Functions| |------|--------| | dplyr | data manipulation - altering and adding variables in a dataset | | tidyr | data tidying - changing data shape and structure | | ggplot2 | data visualisation | | purrr | Enhancements on functional programming | ] --- background-image: url(img/hex_yes.png), url(img/hex_not.png) background-size: 15% background-position: 37% 20%, 90% 20% ## The packages .pull-left[ ### Covered here |Package|Functions| |------|--------| | dplyr | data manipulation - altering and adding variables in a dataset | | tidyr | data tidying - changing data shape and structure | | ggplot2 | data visualisation | | purrr | Enhancements on functional programming | ] .pull-right[ ### Not covered |Package|Functions| |------|--------| | readr | easy and fast importing of data | | tibble | variations on the R data.frame | | forcats | working with factors/categorical data | | stringr | working with strings/characters | ] --- ## What's so special about them? - **made to work with data sets (tibbles / data.frames)** - geared towards data-scientists and folks working with rectangular data -- - **made to work together** - naming and argument conventions -- - **use function names similar to spoken language** - verbs and adverb function names -- - **arguments can be chained (piped) together** - avoids saving intermediary objects - input always as first argument -- - **packages are actively developed and maintained by RStudio** - functions will not abruptly or without warning and careful thought change behaviour