library(tm)
reut21578 <- system.file("texts", "crude", package = "tm")
reuters <- Corpus(DirSource(reut21578),
readerControl = list(reader = readReut21578XML))
file <- "reut-0001.xml"
reuters <- Corpus(ReutersSource(file), readerControl = list(reader = readReut21578XML))
I am using tm package for accessing reuters data but IN ReutersSource i am getting error
Error in inherits(x, "Source") : could not find function "ReutersSource"
I think the developers have removed
ReutersSource()from the source code of the tm package.If you want to read in a single specific file you can pass a filter expression to the
DirSource()function, like this:Result: