O'Reilly logo

Data Analysis with R - Second Edition by Tony Fischetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting started

Base R functions to wield regular expressions have been around since the project got started in the form of functions like gsub and grep. It seems, though, that a recent and popular approach is to use the stringr package (which is based on the excellent and  more extensive stringi package). Both because the format/argument order of the stringr functions are more consistent than their base R counterparts and because I would like to keep you abreast of popular trends in R programming, we'll be using this package to learn regex in R. Since all of the functions that we'll be using take a string (or vector of strings) to perform regex operations on as the first argument, we'll also be using the magrittr pipe operator (introduced ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required