String processing in R

Case

snakecase::to_any_case() help to fix the case of words - useful for converting between presentation data and processing data.

Regex

The regex in R is not 100% perl flavored. For example, escape character is \\ instead of \.

I love the [{rev}](https://github.com/kevinushey/rex package). The most salient point that this package solves is on the interpretation of regex.

When not to use regex

Not all strings are interpreted as a regex. Sometimes, one needs to opt-in via a parameter in the function. I have also found myself mistakenly using regex with the ==, which expects a pure string.

{stringr}

general pattern: str_x(string, pattern). (I sometimes forgot that it is the variable to be put in front).

Avatar
Tim

Personalizing medicine

Related