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.
purrr
- purrr basicsmap returns a list; the typed variants return a vector of that type.
- purrr over several inputsmap2 walks two vectors together; pmap walks a list of them.
- purrr and failuresafely and possibly turn an error into a value you can inspect.
- reduce and accumulateFolding a list into one value, or keeping every step.
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
Encore
- log_digest.RFunctional R: parse log lines with stringr, fold them with purrr, report.