I have a matrix whose columns are the separation of different phrases into independent words. Example:
Phrase | Word_1 | word_2 | Word_3 |
---|---|---|---|
sample text | Text | of | example |
example sentence | Phrase | of | example |
separate word | Word | separated | NA |
Thanks in advance | Thank you | of | beforehand |
I need to extract a vector as a dictionary in which the unique values of these separate words are found. Applied to the example, the result I need is the following:
Dictionary |
---|
beforehand |
of |
example |
phrase |
Thank you |
word |
separated |
text |
Note that the code must omit NAs, as all phrases are not the same length.
Thank you very much for your help.
Regards, J