Top "Stringr" questions

The stringr package is a wrapper for the R stringi package that provides consistent function names and error handling for string manipulation.

If else statements to check if a string contains a substring in R

I have a list that contains multiple strings for each observation (see below). [1] A, C, D [2] P, O, E [3] W, …

r regex if-statement stringr
count the number of occurrences of "(" in a string

I am trying to get the number of open brackets in a character string in R. I am using the …

r stringr
Remove URLs from string

I have a vector of strings—myStrings—in R that look something like: [1] download file from `http://example.com` [2] this …

r string stringr
Filter by multiple patterns with filter() and str_detect()

I would like to filter a dataframe using filter() and str_detect() matching for multiple patterns without multiple str_detect() …

r stringr tidyverse stringi
How to remove + (plus sign) from string in R?

Say I use gsub and want to remove the following (=,+,-) sign from the string and replace with an underscore. …

r gsub stringr
R get last element from str_split

I have a R list of strings and I want to get the last element of each require(stringr) string_…

r regex stringr
dplyr: inner_join with a partial string match

I'd like to join two data frames if the seed column in data frame y is a partial match on …

r string join dplyr stringr
Using dplyr and stringr to replace all values starts with

my df > df <- data.frame(food = c("fruit banana", "fruit apple", "fruit grape", "bread", "meat"), sold = rnorm(5, 100)) &…

r dplyr stringr
Installation of packages ‘stringr’ and ‘stringi’ had non-zero exit status

Please help me to install stringr and stringi packages in R. The result is: install.packages("stringi") Installing package into ‘…

r stringr stringi
Non-greedy string regular expression matching

I'm pretty sure I'm missing something obvious here, but I cannot make R to use non-greedy regular expressions: > library(…

regex r stringr