str_pos(searchString, findTerm, maxdist = 2, part.dist.match = 0,
showProgressBar = FALSE)
searchString
.searchString
. Following values are accepted:
TRUE
, the progress bar is displayed when computing the distance matrix.
Default in FALSE
, hence the bar is hidden.searchString
that
partially match or are similar to findTerm
. Returns -1
if no
match was found.group_str
string <- c("Hello", "Helo", "Hole", "Apple", "Ape", "New", "Old", "System", "Systemic")
str_pos(string, "hel") # partial match
str_pos(string, "stem") # partial match
str_pos(string, "R") # no match
str_pos(string, "saste") # similarity to "System"
# finds two indices, because partial matching now
# also applies to "Systemic"
str_pos(string,
"sytsme",
part.dist.match = 1)
# finds nothing
str_pos("We are Sex Pistols!", "postils")
# finds partial matching of similarity
str_pos("We are Sex Pistols!", "postils", part.dist.match = 1)
Run the code above in your browser using DataLab