## Not run: 
# 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)## End(Not run)
Run the code above in your browser using DataLab