为什么 R 包 exams 的 nops_scan 函数不创建 zip 文件?

Why doesn't the nops_scan function of the R package exams create zip file?

我正在尝试 运行 考试包 (http://www.r-exams.org/tutorials/exams2nops/) 中的笔试教程。一切正常,直到我要使用 nops_scan 函数处理扫描的文档,该函数通常会创建一个 zip 文件。

在控制台中显示 "Creating ZIP file",但此后没有任何反应。最后输出:

    > nops_scan(dir = "nops_scan")
    Loading required namespace: png
    Reading PNG files:nops_scan1.png: Trimming PNG, rotating PNG, 
    extracting information, done.nops_scan2.png: Trimming PNG, rotating   
    PNG, extracting information, done.

    Creating ZIP file:

...然后什么也没有发生。

我已尝试 运行 dir("nops_scan"),它确认没有生成任何 zip 文件并将其放置在该文件夹中。

教程中的文件是 png 文件,因此教程中关于 运行ning pdftk 和 ImageMagick 的内容不适用。来自教程:"Note that if there were PDF files that need to be scanned, then the PDF toolkit pdftk and the function convert from ImageMagick need to be available outside of R on the command line."

问题是否仍然与上述关于 pdftk 或 ImageMagick 的评论有关? (哪个程序用于创建 zip 文件?)我不知道如何制作这些程序 "available outside of R",因此不胜感激!

使用 tools 包中的基础 zip() 函数,请参阅 ?zip。如果您在 Windows 上,也许您需要安装 Rtools?这些可从 CRAN 获得,网址为 https://CRAN.R-project.org/bin/windows/Rtools/

PDFTk 和 ImageMagick 不涉及这种情况,它们只需要将 PDF 文件转换为 PNG,然后可以在 R 中处理。(以防万一其他人正在寻找此信息:http://www.R-exams.org/tutorials/installation/ 提供指向这些应用程序的安装文件的链接。)