You are hereBlogs / Michael Levy's blog / Tidyverse Tutorial

Tidyverse Tutorial

  • strict warning: Non-static method view::load() should not be called statically in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/views.module on line 1118.
  • strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_field.inc on line 0.
  • strict warning: Declaration of views_handler_argument::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_argument::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_argument.inc on line 0.
  • strict warning: Declaration of views_handler_sort::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_sort.inc on line 0.
  • strict warning: Declaration of views_handler_sort::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_sort.inc on line 0.
  • strict warning: Declaration of views_handler_sort::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_sort.inc on line 0.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_filter.inc on line 0.
  • strict warning: Declaration of views_handler_area::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_area.inc on line 0.
  • strict warning: Declaration of views_handler_area_text::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_area_text.inc on line 0.
  • strict warning: Declaration of views_plugin_query::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/plugins/views_plugin_query.inc on line 0.
  • strict warning: Declaration of views_plugin_argument_validate::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/plugins/views_plugin_argument_validate.inc on line 0.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/plugins/views_plugin_row.inc on line 0.
  • strict warning: Non-static method view::load() should not be called statically in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/views.module on line 1118.
  • strict warning: Declaration of views_handler_relationship::query() should be compatible with views_handler::query($group_by = false) in /opt/drupal6/environmentalpolicy.ucdavis.edu/modules/views/handlers/views_handler_relationship.inc on line 0.

By Michael Levy - Posted on 17 October 2016

Last week, I gave an overview of bunch of tidyverse packages (tibble, dplyr, tidyr, ggplot, readr, purrr) to the Davis R-Users’ Group. Here is that talk (and since videos don’t display everywhere this blog is syndicated, here is the YouTube link).

I mention early in the talk that the github_markdown specification in the YAML header produces a conveniently GitHub-renderable markdown file – here that is if you’d like to follow along, or you can download the rendered R Notebook (nb.html) file, which itself includes the R Markdown file (Awesome! In the upper right of the html file, click “Code” -> “Download Rmd”).

One final note, on the speed of tidyverse functions. Some tidyverse functions really do offer a speed advantage over base R (e.g. read_csv and filter), but the map speed advantage I mention here over lapply seems to be an artifact of both being wrapped in a map2 call in a data_frame call. They are actually equally fast. In my mind, the benefit of the tidyverse is that it makes R easier to write and read, which makes it less bug-prone and more approachable for beginners. It does that without imposing a speed penalty, and in some cases provides a little acceleration as a bonus.