I am trying to export Corpus objects from R to static files. The packages contain source documents created by analyzing existing pre-processed files in the file system. The author describes a method for this in his Introduction to Text Span in R (p. 2), proposing
> writeCorpus(file)
but my attempts so far give only the following:
Error in UseMethod("as.PlainTextDocument", x): no applicable method for 'as.PlainTextDocument' applied to an object of class "character"
My script is pretty simple so far, and I expect it to be a simple miss. Any advice is appreciated: this seems like a problem.
FWIW: Calling class(corpora) returns [1] "VCorpus" "Corpus" "list" so the objects apparently are not of type character
source share