R Aspell homebrew

前端 未结 4 586
说谎
说谎 2021-02-02 10:44

working on a Macbook pro with OS 10.6. I\'ve recently installed the package Aspell with the R package manager and it appears the install went just fine (no install errors). but

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-02 11:38

    As a note, aspell() works with factors but not character vectors. This won't help til after you have Aspell (or another spell checker) installed, but afterwards if you want to use aspell() on data in R (instead of just working on files), make sure it's properly formatted.

    Here's an example:

    > str1 <- "This is a string with a mispeled word"
    > str1 <- as.character(str1)
    > aspell(str1)
    Error in file(con, "r") : cannot open the connection
    In addition: Warning message:
    In file(con, "r") :
      cannot open file 'This is a string with a mispeled word': No such file or directory
    > str1 <- "This is a string with a mispelled word"
    > str1 <- as.factor(str1)
    > results1 <- aspell(str1)
    > results1 
    mispelled
      :1:25
    

提交回复
热议问题