我正在尝试分析 R 中的 pdf 文件。按照 data.library.virginia.edu/reading-pdf-files-into-r-for-text-mining/ 上的说明进行操作。前几个步骤效果很好,但我意识到我必须以某种方式将 PDF 文件连接到 R 中的列表。我想我已经正确地使用了在 Windows 中使用函数 xpdf 的说明。
以下是我迄今为止在 R 中的编码。
library(tm)
files <- list.files(pattern = "pdf$")
Rpdf <- readPDF(control = list(text = "-layout"))
Comments <- Corpus(URISource(files),
readerControl = list(reader = Rpdf))
Comments.tdm <- TermDocumentMatrix(Comments, control = list(removePunctuation = TRUE,
stopwords = TRUE,
tolower = TRUE,
stemming = TRUE,
removeNumbers = TRUE,
bounds = list(global = c(3, Inf))))
这是我在这个论坛上的第一个问题(相当初学者),所以如果有什么不清楚的或者我把这个问题表述错了,我很乐意听到。