R Aspell homebrew

前端 未结 4 525
说谎
说谎 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:45

    I don't understand what you are doing. aspell is a function in the utils package and is, therefore, loaded by default when R is started up. The first argument to aspell is a file name, not a text vector. You may need to install a dictionary that the aspell function can access. But on my Mac I already have several versions installed (and may need to do some cleaning.) The Omegahat repository also has one that is tested with R. The interface with Aspell will probably be attempting to select the correct language. You can see what R thinks is the correct language with sessionInfo() and look at your LOCALE settings. You can find the location of your Aspell installation with Terminal.app by entering locate aspell at the command prompt.

    This is a modification of the example in help(aspell) that spell-checks t*.dat files:

    files <- Sys.glob("~/t*.dat")
     res <- aspell(files)
     str(res)
     length(res$File)
    #[1] 309    # so I probably should have been more narrow than asking for .dat files beginning with "t".
    

提交回复
热议问题