我想在R中嵌入我自己的单词。我试图打开并接收pdf中的文本,但它给出了这个错误: Error in normalizePath(path.expand(path),winslash,mustWork):path1="goethe_faust.pdf":找不到文件
奇怪的是,这个文件存在,我可以用任何pdf阅读器打开它。它没有被密码锁住或者类似的东西。我的代码:
library(pdftools)
file_vector <- list.files(path = "pdf_collections")
pdf_text <- pdf_text(file_vector[1]) 发布于 2020-12-29 23:25:51
默认情况下,list.files只包含文件名。要打开这些文件,您需要包含路径(pdf_collections)。您可以通过指定需要文件的完整路径来修复此问题。
file_vector <- list.files(path = "pdf_collections", full.names=TRUE)https://stackoverflow.com/questions/65494346
复制相似问题