I want to find the most frequent bigram letters in a text in R.

Example: text = "Hello my name is Ana"

Output: "he", "ll", "om", "yn", "am", "ei" "sa" "na"

Any help would be appreaicted.

  • 4
    I’m voting to close this question because it is not about linguistics. – Nardog May 28 at 19:30
  • You should use stringi or stringr package with regex. – amegnunsen May 29 at 9:23
  • What do you even mean by “most frequent bigram letters”? The output you give contains eight of the fourteen bigrams in the example text, of which one is the most frequent (na, frequency = 2) and the other four are of equal frequency (1) with the six missing bigrams. So why exactly are you expecting R to output this? – Janus Bahs Jacquet May 29 at 13:19