0

I am trying to use the TreeTagger function in R for POS analysis (on a Mac laptop).

However, I keep getting an error message when running the following code:

tagged.text <- treetag(reviews, 
    treetagger = "kRp.env", 
    rm.sgml = TRUE, 
    lang = "en", 
    apply.sentc.end = TRUE, 
    sentc.end = c(".", "!", "?", ";", ":"), 
    encoding = NULL, 
    TT.options=list(path="~/Desktop/TreeTagger/", preset="en"), 
    debug = FALSE, 
    TT.tknz = TRUE, 
    format = "file", 
    stopwords = NULL, 
    stemmer = NULL)

Error Message: Error in path.expand(path) : invalid 'path' argument

I set up the package as follows:

set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/", 
                       preset = "eng", 
        validate = TRUE)
set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/bin", 
                       preset = "eng", 
        validate = TRUE)
set.kRp.env(TT.cmd = "manual", lang = "en", 
        path = "~/Desktop/TreeTagger/cmd", 
                       preset = "eng", 
        validate = TRUE)

Does anyone know what the issue here could be?

Ceri
  • 27
  • 5
  • I think you need to specify your paths as `"/Users/username/Desktop/TreeTagger"` . – DJack Apr 22 '18 at 09:38
  • I just tried that and then I get the Error Message: Error: Specified directory cannot be found: /Users/Ceri/TreeTagger//bin – Ceri Apr 22 '18 at 09:56
  • You forgot Desktop in the path – DJack Apr 22 '18 at 10:58
  • Unfortunately even with Desktop I still get this message: Error: Specified directory cannot be found: /Users/Ceri/Desktop/TreeTagger//bin – Ceri Apr 22 '18 at 12:19
  • The only thing I can say with the information you have provided is that, most probably, TreeTagger is not at this emplacement. Here are some explanations to find the path of a folder in Mac Os X: https://www.josharcher.uk/code/find-path-to-folder-on-mac/ – DJack Apr 22 '18 at 13:40

0 Answers0