thank for your Help, but unfortunately that is not my solution.
My goal is that every word in the twitter dataset (Text) is replaced by their frequency rank of the whole twitter dataset (15000 tweets).
I already ranked all words by their frequency. The whole dataset has 18420 words, so every word in the text got a rank by their frequency.
Now I want that the words in the tweets are replaced by the frequency rank. So every word is replaced by the rank of the word frequency, between 1 and 18420.
For example the first tweets should look like this:
Apropos #baerbockfails Von #CDU und #CSU ist die sogenannte "bürgerliche Mitte" Betrug und Trickserei gewöhnt.
Frequency rank of the words:
The transformed tweet should then look like this:
Words replaced by word frequency rank:
              
I hope I could clarify my point and looking forward for every help!