I am new to R, but I really like it and want to constantly improve. Now, after working for some time, I have to ask you for help.
This is a given case:
1) I have sentences (sentence .1 and sentence .2 - all words are already lowercase) and create sorted lists of frequencies of their words:
sentence.1 <- "bob buys this car, although his old car is still fine."
Here are the results:
sentence.1.freq: although bob buys car fine his is old still this 1 1 1 2 1 1 1 1 1 1 sentence.2.freq: a can car cost month much per very you 1 1 1 1 1 1 1 1 1
Now, please, how could I combine these two frequency lists so that I will have the following:
a although bob buys can car cost fine his is month much old per still this very you NA 1 1 1 NA 2 NA 1 1 1 NA NA 1 NA 1 1 NA NA 1 NA NA NA 1 1 1 NA NA NA 1 1 NA 1 NA NA 1 1
Thus, this "table" should be "flexible" so that in the case of entering a new sentence with a word, for example. "and", the table will add a column labeled "and" between "a" and "although".
I thought about simply adding new sentences to a new line and putting all the non words that are not yet listed in the column of the list (here, βandβ will be on your right β) and sorting the list again, However, I could not handle it. since the sorting of the frequencies of the new sentence words according to the existing inscriptions did not work (when, for example, there is, for example, βcarβ, the frequency of the new car offer should be written in a new sentence line and the column βcarβ, but when for the first time there is "you", its frequency should be A new column with the inscription "you" is written in a new sentence line).