typestar

Functional & text tools

10 steps in 4 sets of R.

Functional programming and the string and date work that usually accompanies it. purrr's map family first, then stringr, then dates with lubridate and factors with forcats.

Ten steps. The map functions replace most of the apply family, and unlike the apply family you can tell what they return from the name.

Start this tour

purrr

stringr

  • stringrConsistent, pipe-friendly string functions.
  • stringrConsistent argument order: the string first, the pattern second.
  • stringr with groupsCapture groups, named or numbered, extracted into a matrix or a tibble.

Dates & factors

  • lubridateParsing by the order of the parts, then arithmetic that respects calendars.
  • forcatsFactors that behave: reordered by another variable, or lumped by frequency.

Encore

  • log_digest.RFunctional R: parse log lines with stringr, fold them with purrr, report.

The other R tours