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
list
s
In other words, we're learning how to draw the f**king owl:
You can install the github version with the following commands:
install.packages("remotes")
remotes::install_github("laderast/tidyowl")
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.
- Understand how
tidyselect
helper functions (contains()
,all_of()
) work withselect()
. - Understand how
where()
works withselect
and.is*
functions - Learn how to combine helpers with
c()
and find the complement using-
- Apply
across()
to work withmutate()
to mutate multiple columns - Apply
across()
withsummarize()
to summarize multiple columns
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/
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.
- 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()
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/
This tutorial was partially derived and inspired from the following links:
- https://jennybc.github.io/purrr-tutorial/ls13_list-columns.html
- https://r4ds.had.co.nz/many-models.html
- https://github.com/jennybc/row-oriented-workflows
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()
.
- 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()
.
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/
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.