Regular expressions. How they can be cruel! Well we’re here to make them a tad easier. To do so we’re going to make use of the {stringr} package install.packages("stringr") library("stringr") We’re going to use the str_detect() and str_subset() functions. In particular the latter. These have the syntax function_name(STRING, REGEX_PATTERN) str_detect() is used to detect whether a string contains a certain pattern. At the most basic use of these functions, we can match strings of text.
regex
Recent Posts
- Alt Text in R: Plots, Reports, and Shiny
- How to customise the style of your {shinydashboard} Shiny app
- Network Error Logging - Important Insights
- SatRdays London 2023: Speakers
- Content Security Policy - Why You Need It
- Why should I use R: The Excel R Data Wrangling comparison: Part 1
- Shiny in Production 2023: Workshops
- Work smarter; not harder: COVID-19 processing for the WHO/Europe
- Should I learn Stan?
- February Training Update