Questions tagged [qdapregex]

qdapRegex is a collection of regular expression tools associated with the qdap package that may be useful outside of the context of discourse analysis. Tools include removal/extraction/replacement of abbreviations, dates, dollar amounts, email addresses, hash tags, numbers, percentages, person tags, phone numbers, times, and zip codes.

9 questions
4
votes
4 answers

Extracting string between words using logical operators in rm_between function

I am trying to extract strings between words. Consider this example - x <- "There are 2.3 million species in the world" This may also take another form which is x <- "There are 2.3 billion species in the world" I need the text between There…
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
1
vote
1 answer

qdapRegex::rm_nchar_words returns different results when non English letters involved?

Please help me with the following confusion: qdapRegex::rm_nchar_words("è ûé", "1,2") [1] "è ûé" qdapRegex::rm_nchar_words('k ku ppp d', "1,2") [1] "ppp" Why in the first code line it doesn't respond with "" but in the second one it works as…
SteveS
  • 3,789
  • 5
  • 30
  • 64
1
vote
1 answer

rm_between with multiple markers in an observation

There are some helpful answers on here about using rm_between when each observation has only one instance of the markers. However I have a dataset where I want to extract things in ""'s and some of the observations have multiple instances of that.…
1
vote
4 answers

With R, when string extraction creates a list element in a data frame, how can you add a row for each item in the list?

I have hundreds of addresses in a data frame variable and need to extract zip codes from them. Some of the addresses contain more than one city, each with a zip code. Here is a mock example of a data frame and R code that extracts the zip…
lawyeR
  • 7,488
  • 5
  • 33
  • 63
0
votes
2 answers

Detect multiple patterns in r using logical operators?

I am trying to detect detect if certain combinations of patterns are present/absent in one variable in a dataframe. There are some questions that are similar, but I could not find one that answers exactly what I am trying to achieve. I am trying to…
Bahi8482
  • 489
  • 5
  • 15
0
votes
0 answers

Extract complex sentence using rm_between

I am using rm_between (from qdapregex) trying to extract text from the sentence below (text is highlighted in bold just to clarify the question, in the original dataset, all text are the same. trying to extract based on the location between 2…
Bahi8482
  • 489
  • 5
  • 15
0
votes
4 answers

How to insert text in specific in directory in R

I am looking for an elegant way to insert character (name) into directory and create .csv file. I found one possible solution, however I am looking another without "replacing" but "inserting" text between specific charaktects. #lets start df…
Mikołaj
  • 385
  • 4
  • 17
0
votes
2 answers

Extract Subpart of pdf text in r

I have a list of .pdf files in a folder for which I want to first access the first two paragraphs of text then store them in .csv file, I'm able to convert the pdf text but not able to extract first two paragraphs. This is what I have…
Andre_k
  • 1,680
  • 3
  • 18
  • 41
0
votes
1 answer

Grep html code between html tags containing a keyword in R

Within a file, I would like to use grep or maybe use the package qdapRegex's rm_between function to extract a whole section of html code containing a keyword, lets say "discount rate" for this example. Specifically, I want results that look like…
Kevin Ocampo
  • 101
  • 7