Last chance! 50% off unlimited learning
Sale ends in
space_fill(text.var, terms, sep = "~~", rm.extra = TRUE,
ignore.case = TRUE, fixed = FALSE, ...)
FALSE
, the pattern matching is case sensitive
and if TRUE
, case is ignored during matching.TRUE
, pattern is a string to be matched as
is. Overrides all conflicting arguments.gsub
.space_fill
is useful for keeping grouped words
together. Many functions in qdap take a char.keep
or
char2space
argument. This can be used to prepare multi word phrases
(e.g., proper nouns) as a single unit.x <- c("I want to hear the Dr. Martin Luther King Jr. speech.",
"I also want to go to the white House to see President Obama speak.")
keeps <- c("Dr. Martin Luther King Jr.", "The White House", "President Obama")
space_fill(x, keeps)
strip(space_fill(x, keeps))
Run the code above in your browser using DataLab