In order to operate with strings in R, you need library stringr for that purpose, so the very first line in your code should be:
library("stringr")
R provides a lot of functions for string manipulations.
Purpose of function word is to retrieve word from string based on index of that particular word.
word(a, b)
- a is string that we are going to search through
- b is index of word in string a we want to retrieve as result
- a is string that we want to receive length as result
- a is string that we want to search through.
- b is word we want to look for.
- result of this function is array of two numbers; one for the beginning index of word b and second is ending index of word b.
- a is string we want to search through for the substring.
- b is staring index of substring we want to receive as result.
- d in ending index of substring we want to receive as result.
- a is string we want to search through.
- b is string that we want to search for occurrences.
- a is string that we want to turn all of letters into upper letters. String with all upper letters is going to be provided as result of this function.
- a is string we want to split
- b is splitting patter written in regular expression.
- a is string that is going to be appended to.
- b is appending string.
- sep is string that is going to be inserted in between a and b.
- a is string that is going to be removed from.
- b i string that is going to be removed.
- a i string that is going to be replaced from.
- b is string for replacement that is a substring of string a.
- d is string that is going to replace substring b in string a.