Hello,
Here is a way of accomplishing that
library(dplyr)
data = c("I have a vector of data that looks like this",
"This is some text",
"This is something different",
"Fish fingers",
"And now for something completely different")
data = sapply(data, function(x) strsplit(x, split = " ")) %>%
unlist() %>% tolower() %>% unique()
data
#> [1] "i" "have" "a" "vector" "of"
#> [6] "data" "that" "looks" "like" "this"
#> [11] "is" "some" "text" "something" "different"
#> [16] "fish" "fingers" "and" "now" "for"
#> [21] "completely"
Created on 2020-08-11 by the reprex package (v0.3.0)
I added the unique and to lower to remove duplicates, but of course you can change that if needed.
Hope this helps,
PJ