Skip to content

Instantly share code, notes, and snippets.

@rafapereirabr
Last active September 6, 2019 00:12
Show Gist options
  • Save rafapereirabr/4a98f4262f1d83eb3022e5f6e1c98b58 to your computer and use it in GitHub Desktop.
Save rafapereirabr/4a98f4262f1d83eb3022e5f6e1c98b58 to your computer and use it in GitHub Desktop.
Using the data.table operator `%like%` for partial string matching:

R tip of the day: partial string matching

The data.table package has the operator %like%, which is super handy for partial string matching:

"system with blue screen" %in% "blue"
> FALSE

"system with blue screen" %like% "blue"
> TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment