title: How to use hunspell package to suggest correct words in a column in R?
body: <p>I'm currently working with a large data frame containing lots of text in each row and would like to effectively identify and replace misspelled words in each sentence with the <code>hunspell</code> package. I was able to identify the misspelled words, but can't figure out how to do <code>hunspell_suggest</code> on a list.</p>
  
  <p>Here is an example of the data frame:</p>
  
  <pre><code>df1 &lt;- data.frame("Index" = 1:7, "Text" = c("A complec sentence joins an independet",
                                              "Mary and Samantha arived at the bus staton before noon",
                                              "I did not see thm at the station in the mrning",
                                              "The participnts read 60 sentences in radom order",
                                              "how to fix mispelled words in R languge",
                                              "today is Tuesday",
                                              "bing sports quiz"))
  </code></pre>
  
  <p>I converted the text column into character and used <code>hunspell</code> to identify the misspelled words within each row.</p>
  
  <pre><code>library(hunspell)
  df1$Text &lt;- as.character(df1$Text)
  df1$word_check &lt;- hunspell(df1$Text)
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>df1$suggest &lt;- hunspell_suggest(df1$word_check)
  </code></pre>
  
  <p>but it keeps giving this error:</p>
  
  <pre><code>Error in hunspell_suggest(df1$word_check) : 
    is.character(words) is not TRUE
  </code></pre>
  
  <p>I'm new to this so I'm not exactly sure how does the suggest column using <code>hunspell_suggest</code> function would turn out. Any help will be greatly appreciated.</p>