stringr
A fresh approach to string manipulation in R
stringr is an R package that provides a cohesive set of functions for working with strings, built on top of the stringi package which uses the ICU C library for fast, correct string manipulation. It focuses on the most common string operations with a consistent interface where all functions start with str_ and take a vector of strings as the first argument.
The package simplifies string manipulation through consistent function naming and behavior that works well with pipes and tidyverse workflows. It provides seven main pattern-matching verbs (detect, count, subset, locate, extract, match, replace, split) that work with regular expressions by default, plus support for fixed bytes, human letter collation, and boundary matching. Compared to base R string functions, stringr offers more predictable behavior where missing inputs produce missing outputs and zero-length inputs produce zero-length outputs.
Contributors#
Resources featuring stringr#
From Data to Dollars: Improving Medical Billing Accuracy Using NLP (Julianne Gent, Emory Healthcare)
Protecting our Healthcare Heroes: Using Natural Language Processing to Prevent Billing Mistakes in Healthcare
Speaker(s): Julianne Gent
Abstract:
Maintaining accurate billing documentation in healthcare is essential to prevent revenue loss and preserve patient satisfaction. I’m Julianne Gent, Analytics Developer for Emory Digital, and I’m here to discuss the natural language processing algorithm we built utilizing an automated SQL-to-R pipeline. This algorithm uses packages ‘odbc’ and ‘stringr’ to import SQL queries into R, recognize billing patterns, and extract billing time. Our algorithm accurately captured billing data for 93% of over 250,000 notes. The billing provided by our hospital’s medical software? Only 40%. Our algorithm showed that an SQL-to-R pipeline can improve billing documentation and accuracy, and we are confident that it can be applied to many other industries. posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/
