GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Cascadia-R/purrr-tutorial: Tutorial introducing the purrr package for solving iteration problems

BranchesTags
Open more actions menu

Latest commit

 

History

26 Commits
26 Commits

Folders and files

NameName
Last commit message
Last commit date
challenges
challenges
 
 
code
code
 
 
data
data
 
 
.gitignore
.gitignore
 
 
01-map.R
01-map.R
 
 
02-typed-functions.R
02-typed-functions.R
 
 
03-challenges.R
03-challenges.R
 
 
04-map2.R
04-map2.R
 
 
05-purrr-list-columns.R
05-purrr-list-columns.R
 
 
06-other-features.R
06-other-features.R
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
purrr_workshop.Rproj
purrr_workshop.Rproj
 
 
slides.pdf
slides.pdf
 
 
slides_with_transitions.pdf
slides_with_transitions.pdf
 
 
useR-abstract.md
useR-abstract.md
 
 

Repository files navigation

A purrr tutorial

This repo hosts the materials for a purrr tutorial. The materials currently reflect the version planned for the Cascadia R Conf, Portland, OR Jun 2017.

Upcoming in-person tutorials

  • Cascadia R Conf Portland, OR, June 3 2017
  • useR! Brussels, Belgium, July 4 2017
  • London R-ladies London, U.K., July 12 2017

Older versions of the materials, from prior in-person tutorials, are also available:

  • rstudio::conf Jan 2017 (2.25 hours)

Outline

Code with a lot of duplication is harder to understand, troubleshoot and maintain. The goal of this tutorial is help you remove duplication in your code by using functions that write for loops for you.

You'll learn to use the functions in the purrr package to perform iterative tasks: tasks that look like "for each _____ do _____".

By the end of the tutorial you'll be writing code that is more readable and easier to update and you'll be ready to solve new iteration problems faster and with fewer mistakes.

Learning Objectives

By the end of the tutorial, you'll be able to:

  • Move from solving a problem on a single element, to iterating that solution over many elements with map().
  • Identify when to use the typed variants of map(): map_lgl(), map_int(), walk() etc.
  • Iterate over two arguments with map2().
  • Leverage purrr to get list data into tibbles.
  • Use purrr to work with list columns in tibbles.

Pre-requisites

Don't worry if you have never written a for loop, used lapply(), written your own function or heard of a tibble, this tutorial is designed to be accessible to beginners.

That said, you should be familiar with exploring and subsetting the basic data structures in R including lists and data frames.

This is a hands-on tutorial, you'll need your laptop with R installed, as well as a few packages:

install.packages("tidyverse")

# install.packages("devtools")
devtools::install_github("jennybc/repurrrsive")

License

Creative Commons License
This purrr tutorial by Charlotte Wickham is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

About

Tutorial introducing the purrr package for solving iteration problems

Resources

Readme
License
Activity
Custom properties

Stars

20 stars

Watchers

5 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.