Skip to content
forked from laderast/tidyowl

LearnR repository for intermediate tidyverse lessons (drawing the f**king owl)

License

Notifications You must be signed in to change notification settings

p-lyons/tidyowl

 
 

Repository files navigation

tidyowl: Learning to draw the owl in the tidyverse

The goal of the tidyowl package is to provide some additional learnr tutorials as a path to learning how to do advanced things with the tidyverse, including:

  • tidyselect
  • rowwise()/nest_by()
  • understanding lists

In other words, we're learning how to draw the f**king owl:

Drawing the owl illustration in "just" two easy steps

Installation

You can install the github version with the following commands:

install.packages("remotes")
remotes::install_github("laderast/tidyowl")

learning_tidyselect

tidyselect lets you programmatically select columns to do things with it. For example, you could select all of the columns in penguins that contains the string "bill".

This tutorial also covers across and other column-wise operations.

Learning Objectives for learning_tidyselect

  • Understand how tidyselect helper functions (contains(), all_of()) work with select().
  • Understand how where() works with select and .is* functions
  • Learn how to combine helpers with c() and find the complement using -
  • Apply across() to work with mutate() to mutate multiple columns
  • Apply across() with summarize() to summarize multiple columns

Run this Tutorial

To run the learning tidyselect tutorial:

library(tidyowl)
learn_tidyselect()

If you don't have R installed on your machine, you can still run the tutorial by going to this mybinder.org link (it may take a little time to launch, be patient):

https://mybinder.org/v2/gh/laderast/tidyowl/master?urlpath=shiny/learning_tidyselect/

learning_rowwise (in development)

Sometimes you need to calculate things row by row. In this tutorial, we cover the rowwise() workflow and use it with mutate()/summarize(). We also cover using nest_by() to make list-columns, and finally run multiple models on each row of a nested data frame.

Learning Objectives

  • Learn and apply rowwise() to produce row-by-row summaries
  • Understand what c_across() does
  • Use nest_by() to make list-columns
  • Access the data in a list-column and do things with it.
  • Run multiple statistical models on a list-column using rowwise()

Run this Tutorial

To run the learning rowwise tutorial:

library(tidyowl)
learn_rowwise()

If you don't have R installed, you can run the tutorial online by going to this mybinder.org link (it may take a little time to launch, be patient):

https://mybinder.org/v2/gh/laderast/tidyowl/master?urlpath=shiny/learning_rowwise/

Acknowledgements

This tutorial was partially derived and inspired from the following links:

Thanks to Rebecca Barter for suggesting that I flesh out the function descriptions some more. Thanks to Garrick Aden-Buie for his suggestion about sum_mm and sum().

learning_lists

Learning Objectives

  • Learn about lists as a general purpose data structure
  • Learn and utilize list properties
  • Access list elements using $ and [[]]
  • Understand the difference between homogeneous and heterogeneous lists
  • Use purrr::pluck() to access list elements
  • Understand how data.frames() are list-like
  • Understand how to apply a function to a list using purrr::map().

Run This Tutorial

To run the learning_lists tutorial:

library(tidyowl)
learn_lists()

If you don't have R installed, you can run the tutorial online by going to this mybinder.org link (it may take a little time to launch, be patient):

https://mybinder.org/v2/gh/laderast/tidyowl/master?urlpath=shiny/learning_lists/

Code of Conduct

Please note that the tidyowl project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

LearnR repository for intermediate tidyverse lessons (drawing the f**king owl)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 99.7%
  • Other 0.3%