Tutorial on R Package "stringr" by Richard Garcia-Guerrero & Adrian Werner
This repository provides materials to learn how to manipulate strings in R using the "stringr" package. It includes a presentation in PowerPoint format providing an overview of "stringr", as well as an R Markdown (RMD) file containing basic exercises to practice using "stringr" functions.
It is part of the I2DS Tools for Data Science workshop run at the Hertie School, Berlin in November 2022. The student-run workshop is part of the course Introduction to Data Science taught by Simon Munzert at the Hertie School, Berlin, in Fall 2022.
This session is divided into two parts: the presentation and the tutorial.
The presentation introduces the participant to string, its uses, and its prevalence in R workflow. Then, it introduces the "stringr" package, describing its functionalities across various categories.
The presentation concludes with a brief overview of regular expressions, and its role in "stringr" commands.
The tutorial provides an opportunity for the participant to familiarize themselves with basic "stringr" functions, as well as regular expressions to supplement their use of "stringr" functionalities.
Upon completion, participants will understand what a string is, its use in R workflow, and how to use the "stringr" package to:
- detect matches,
- mutate strings,
- subset strings,
- join and split strings,
- manage the length of strings,
- sort and order strengths,
- and more.
- stringr overview at stringr.tidyverse.org
- R for Data Science book - stringr
- Stringr "Cheat Sheet" (PDF download)
- Stringr all functions
The material in this repository is made available under the MIT license.
Adrian Werner prepared the practice material. He also reviewed and corrected the presentation slides.
Richard Garcia-Guerrero prepared the presentation slides and recording. He also reviewed and corrected the practice material.