Preface

See the controls at the top of the website for searching, font size, editing, and a link to the PDF version of the material.

Package versions used

Click to expand

withr::with_options(list(width = 80), print(sessioninfo::session_info()))
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 3.6.1 (2017-01-27)
##  os       Ubuntu 16.04.6 LTS          
##  system   x86_64, linux-gnu           
##  ui       X11                         
##  language en_US.UTF-8                 
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       UTC                         
##  date     2019-11-29                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package      * version     date       lib source                              
##  askpass        1.1         2019-01-13 [1] CRAN (R 3.6.1)                      
##  assertthat     0.2.1       2019-03-21 [1] CRAN (R 3.6.1)                      
##  backports      1.1.5       2019-10-02 [1] CRAN (R 3.6.1)                      
##  beeswarm       0.2.3       2016-04-25 [1] CRAN (R 3.6.1)                      
##  bookdown       0.16        2019-11-22 [1] CRAN (R 3.6.1)                      
##  broom          0.5.2       2019-04-07 [1] CRAN (R 3.6.1)                      
##  cellranger     1.1.0       2016-07-27 [1] CRAN (R 3.6.1)                      
##  cli            1.1.0       2019-03-19 [1] CRAN (R 3.6.1)                      
##  codetools      0.2-16      2018-12-24 [3] CRAN (R 3.6.1)                      
##  colorspace     1.4-1       2019-03-18 [1] CRAN (R 3.6.1)                      
##  conflicted   * 1.0.4       2019-06-21 [1] CRAN (R 3.6.1)                      
##  crayon         1.3.4       2017-09-16 [1] CRAN (R 3.6.1)                      
##  crosstalk      1.0.0       2016-12-21 [1] CRAN (R 3.6.1)                      
##  curl           4.2         2019-09-24 [1] CRAN (R 3.6.1)                      
##  data.table     1.12.6      2019-10-18 [1] CRAN (R 3.6.1)                      
##  DBI            1.0.0       2018-05-02 [1] CRAN (R 3.6.1)                      
##  dbplyr         1.4.2       2019-06-17 [1] CRAN (R 3.6.1)                      
##  digest         0.6.23      2019-11-23 [1] CRAN (R 3.6.1)                      
##  dplyr        * 0.8.3       2019-07-04 [1] CRAN (R 3.6.1)                      
##  DT             0.10        2019-11-12 [1] CRAN (R 3.6.1)                      
##  ellipsis       0.3.0       2019-09-20 [1] CRAN (R 3.6.1)                      
##  evaluate       0.14        2019-05-28 [1] CRAN (R 3.6.1)                      
##  fansi          0.4.0       2018-10-05 [1] CRAN (R 3.6.1)                      
##  farver         2.0.1       2019-11-13 [1] CRAN (R 3.6.1)                      
##  fastmap        1.0.1       2019-10-08 [1] CRAN (R 3.6.1)                      
##  forcats      * 0.4.0       2019-02-17 [1] CRAN (R 3.6.1)                      
##  foreign        0.8-71      2018-07-20 [3] CRAN (R 3.6.1)                      
##  fs             1.3.1       2019-05-06 [1] CRAN (R 3.6.1)                      
##  gapminder    * 0.3.0       2017-10-31 [1] CRAN (R 3.6.1)                      
##  gdtools      * 0.2.1       2019-10-14 [1] CRAN (R 3.6.1)                      
##  generics       0.0.2       2018-11-29 [1] CRAN (R 3.6.1)                      
##  gganimate    * 1.0.4       2019-11-18 [1] CRAN (R 3.6.1)                      
##  ggbeeswarm   * 0.6.0       2017-08-07 [1] CRAN (R 3.6.1)                      
##  ggforce      * 0.3.1       2019-08-20 [1] CRAN (R 3.6.1)                      
##  ggiraph      * 0.7.0       2019-10-31 [1] CRAN (R 3.6.1)                      
##  ggplot2      * 3.2.1       2019-08-10 [1] CRAN (R 3.6.1)                      
##  ggpmisc      * 0.3.2       2019-11-11 [1] CRAN (R 3.6.1)                      
##  ggpubr       * 0.2.4       2019-11-14 [1] CRAN (R 3.6.1)                      
##  ggrepel      * 0.8.1       2019-05-07 [1] CRAN (R 3.6.1)                      
##  ggsci        * 2.9         2018-05-14 [1] CRAN (R 3.6.1)                      
##  ggsignif       0.6.0       2019-08-08 [1] CRAN (R 3.6.1)                      
##  ggtext         0.1.0       2019-11-27 [1] Github (clauswilke/ggtext@cc8ea0c)  
##  ggthemes       4.2.0       2019-05-13 [1] CRAN (R 3.6.1)                      
##  git2r          0.26.1      2019-06-29 [1] CRAN (R 3.6.1)                      
##  glue           1.3.1       2019-03-12 [1] CRAN (R 3.6.1)                      
##  gridtext       0.1.0       2019-11-27 [1] Github (clauswilke/gridtext@9378f70)
##  gtable         0.3.0       2019-03-25 [1] CRAN (R 3.6.1)                      
##  haven          2.2.0       2019-11-08 [1] CRAN (R 3.6.1)                      
##  here         * 0.1         2017-05-28 [1] CRAN (R 3.6.1)                      
##  hms            0.5.2       2019-10-30 [1] CRAN (R 3.6.1)                      
##  htmltools      0.4.0       2019-10-04 [1] CRAN (R 3.6.1)                      
##  htmlwidgets    1.5.1       2019-10-08 [1] CRAN (R 3.6.1)                      
##  httpuv         1.5.2       2019-09-11 [1] CRAN (R 3.6.1)                      
##  httr           1.4.1       2019-08-05 [1] CRAN (R 3.6.1)                      
##  jpeg           0.1-8.1     2019-10-24 [1] CRAN (R 3.6.1)                      
##  jsonlite       1.6         2018-12-07 [1] CRAN (R 3.6.1)                      
##  knitr          1.26        2019-11-12 [1] CRAN (R 3.6.1)                      
##  labeling       0.3         2014-08-23 [1] CRAN (R 3.6.1)                      
##  later          1.0.0       2019-10-04 [1] CRAN (R 3.6.1)                      
##  lattice        0.20-38     2018-11-04 [3] CRAN (R 3.6.1)                      
##  lazyeval       0.2.2       2019-03-15 [1] CRAN (R 3.6.1)                      
##  leaflet      * 2.0.3       2019-11-16 [1] CRAN (R 3.6.1)                      
##  lifecycle      0.1.0       2019-08-01 [1] CRAN (R 3.6.1)                      
##  lubridate      1.7.4       2018-04-11 [1] CRAN (R 3.6.1)                      
##  magrittr     * 1.5         2014-11-22 [1] CRAN (R 3.6.1)                      
##  markdown       1.1         2019-08-07 [1] CRAN (R 3.6.1)                      
##  MASS           7.3-51.4    2019-03-31 [3] CRAN (R 3.6.1)                      
##  memoise        1.1.0       2017-04-21 [1] CRAN (R 3.6.1)                      
##  mime           0.7         2019-06-11 [1] CRAN (R 3.6.1)                      
##  modelr         0.1.5       2019-08-08 [1] CRAN (R 3.6.1)                      
##  munsell        0.5.0       2018-06-12 [1] CRAN (R 3.6.1)                      
##  nlme           3.1-140     2019-05-12 [3] CRAN (R 3.6.1)                      
##  nycflights13 * 1.0.1       2019-09-16 [1] CRAN (R 3.6.1)                      
##  openssl        1.4.1       2019-07-18 [1] CRAN (R 3.6.1)                      
##  openxlsx       4.1.3       2019-11-07 [1] CRAN (R 3.6.1)                      
##  patchwork    * 0.0.1.9000  2019-11-28 [1] Github (thomasp85/patchwork@9c1e283)
##  pillar         1.4.2       2019-06-29 [1] CRAN (R 3.6.1)                      
##  pkgconfig      2.0.3       2019-09-22 [1] CRAN (R 3.6.1)                      
##  plotly       * 4.9.1       2019-11-07 [1] CRAN (R 3.6.1)                      
##  plyr           1.8.4       2016-06-08 [1] CRAN (R 3.6.1)                      
##  png            0.1-7       2013-12-03 [1] CRAN (R 3.6.1)                      
##  polyclip       1.10-0      2019-03-14 [1] CRAN (R 3.6.1)                      
##  prettyunits    1.0.2       2015-07-13 [1] CRAN (R 3.6.1)                      
##  progress       1.2.2       2019-05-16 [1] CRAN (R 3.6.1)                      
##  promises       1.1.0       2019-10-04 [1] CRAN (R 3.6.1)                      
##  purrr        * 0.3.3       2019-10-18 [1] CRAN (R 3.6.1)                      
##  R6             2.4.1       2019-11-12 [1] CRAN (R 3.6.1)                      
##  RColorBrewer   1.1-2       2014-12-07 [1] CRAN (R 3.6.1)                      
##  Rcpp           1.0.3       2019-11-08 [1] CRAN (R 3.6.1)                      
##  readr        * 1.3.1       2018-12-21 [1] CRAN (R 3.6.1)                      
##  readxl         1.3.1       2019-03-13 [1] CRAN (R 3.6.1)                      
##  reprex         0.3.0       2019-05-16 [1] CRAN (R 3.6.1)                      
##  reshape2       1.4.3       2017-12-11 [1] CRAN (R 3.6.1)                      
##  rio            0.5.16      2018-11-26 [1] CRAN (R 3.6.1)                      
##  rlang          0.4.2.9000  2019-11-27 [1] Github (r-lib/rlang@1be25e7)        
##  rmarkdown      1.18        2019-11-27 [1] CRAN (R 3.6.1)                      
##  rpart          4.1-15      2019-04-12 [3] CRAN (R 3.6.1)                      
##  rprojroot      1.3-2       2018-01-03 [1] CRAN (R 3.6.1)                      
##  rstudioapi     0.10        2019-03-19 [1] CRAN (R 3.6.1)                      
##  rvest          0.3.5       2019-11-08 [1] CRAN (R 3.6.1)                      
##  scales         1.1.0       2019-11-18 [1] CRAN (R 3.6.1)                      
##  sessioninfo    1.1.1       2018-11-05 [1] CRAN (R 3.6.1)                      
##  shiny          1.4.0       2019-10-10 [1] CRAN (R 3.6.1)                      
##  stringi        1.4.3       2019-03-12 [1] CRAN (R 3.6.1)                      
##  stringr      * 1.4.0       2019-02-10 [1] CRAN (R 3.6.1)                      
##  systemfonts    0.1.1       2019-07-01 [1] CRAN (R 3.6.1)                      
##  tibble       * 2.1.3       2019-06-06 [1] CRAN (R 3.6.1)                      
##  tic            0.2.13.9021 2019-11-29 [1] Github (ropenscilabs/tic@afd2c0f)   
##  tidyr        * 1.0.0       2019-09-11 [1] CRAN (R 3.6.1)                      
##  tidyselect     0.2.5       2018-10-11 [1] CRAN (R 3.6.1)                      
##  tidyverse    * 1.3.0       2019-11-21 [1] CRAN (R 3.6.1)                      
##  tinytex        0.17        2019-10-30 [1] CRAN (R 3.6.1)                      
##  tweenr         1.0.1       2018-12-14 [1] CRAN (R 3.6.1)                      
##  utf8           1.1.4       2018-05-24 [1] CRAN (R 3.6.1)                      
##  uuid           0.1-2       2015-07-28 [1] CRAN (R 3.6.1)                      
##  vctrs          0.2.0       2019-07-05 [1] CRAN (R 3.6.1)                      
##  vipor          0.4.5       2017-03-22 [1] CRAN (R 3.6.1)                      
##  viridisLite    0.3.0       2018-02-01 [1] CRAN (R 3.6.1)                      
##  withr          2.1.2       2018-03-15 [1] CRAN (R 3.6.1)                      
##  xaringan       0.13        2019-10-30 [1] CRAN (R 3.6.1)                      
##  xfun           0.11        2019-11-12 [1] CRAN (R 3.6.1)                      
##  xml2           1.2.2       2019-08-09 [1] CRAN (R 3.6.1)                      
##  xtable         1.8-4       2019-04-21 [1] CRAN (R 3.6.1)                      
##  yaml           2.2.0       2018-07-25 [1] CRAN (R 3.6.1)                      
##  zeallot        0.1.0       2018-01-28 [1] CRAN (R 3.6.1)                      
##  zip            2.0.4       2019-09-01 [1] CRAN (R 3.6.1)                      
## 
## [1] /home/travis/R/Library
## [2] /usr/local/lib/R/site-library
## [3] /home/travis/R-bin/lib/R/library

License

Licensed under CC-BY-NC 4.0.

Speakers

Kirill Müller (@krlmlr) https://www.cynkra.com/about.html

  • Co-founder cynkra
  • Computer + data science
  • Workflows, user interfaces, databases
  • R package author + maintainer

Patrick Schratz (@pat-s) https://pat-s.me

  • M.Sc. Geoinformatics
  • Researcher/Research Engineer at University of Jena and LMU Munich
  • PhD Candidate

  • Unix & R enthusiast
  • Author/Contributor/Maintainer of several R packages:
    • (mlr3, mlr)
    • sperrorest
    • oddsratio
    • xaringan
    • circle
    • RQGIS
    • travis
    • tic

Introduction

© Allison Horst

Figure 0.1: © Allison Horst

The tidyverse has quickly developed over the last years. Its first implementation as a collection of partly older packages was in the second half of 2016. All its packages “share an underlying design philosophy, grammar, and data structures.”1 It is for sure difficult to tell, if “learning the tidyverse” is a hard task, since the result of this assessment might differ from person to person. We do believe though, that there are concepts in its approach, which – when grasped – have the potential to increase one’s productivity, since code creation will seem more natural. While this might be true for all languages (once you speak it well enough, things go smoothly), in our opinion the tidyverse worth exploring in depth, since it is

  1. consistent: an especially well designed framework that aims at making data analysis and programming intuitive,
  2. evolving: constantly deepened understanding for challenges arising in modern data analysis leads to improving ergonomic user interfaces.

This course covers several topics, which everyone working more intently with the tidyverse almost inevitably needs to deal with at some point or another. The topics are organized in chapters that contain mostly R code with output and text. In each section, exercises are provided.

© Allison Horst

Figure 0.2: © Allison Horst


  1. citation from tidyverse homepage