对 RStudio 中的“工具未安装或不在 PATH:ghostcript"警告进行故障排除 [英] Troubleshooting 'Tool(s) not installed or not in PATH: ghostcript' warning in RStudio
问题描述
警告信息
In has_crop_tools() :
Tool(s) not installed or not in PATH: ghostcript
-> As a result, figure cropping will be disabled.
在将简单的 R Markdown 文档编入 PDF 时出现:
appears when a simple R Markdown document is knitted to PDF:
---
output: pdf_document
---
![foo](bar.png)
bar.png
图片嵌入到PDF中没问题,但是调用ghostcript
命令好像有拼写错误(不应该是ghosts在 Ghostscript 解释器名称后的脚本?).如何正确处理此警告消息?
The bar.png
image is embedded into PDF all right, but it looks like there is a spelling error in called ghostcript
command (shouldn't it be ghostscript after the name of Ghostscript interpreter?). How to properly address this warning message?
我的 xfun::session_info()
输出:
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042), RStudio 1.4.1103
Locale:
LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
LC_NUMERIC=C LC_TIME=English_United States.1252
Package version:
base64enc_0.1.3 compiler_4.0.4 digest_0.6.27 evaluate_0.14 glue_1.4.2 graphics_4.0.4 grDevices_4.0.4
highr_0.8 htmltools_0.5.0 jsonlite_1.7.1 knitr_1.31 magrittr_2.0.1 markdown_1.1 methods_4.0.4
mime_0.9 rlang_0.4.10 rmarkdown_2.7 stats_4.0.4 stringi_1.5.3 stringr_1.4.0 tinytex_0.27
tools_4.0.4 utils_4.0.4 xfun_0.19 yaml_2.2.1
推荐答案
你需要告诉 R 在哪里可以找到 ghostscript.对于 Windows,请从 http://ghostscript.com/download/gsdnld.html 下载 ghostscript安装 ghostscript 后,我们仍然需要告诉 R 在哪里可以找到 ghostscript.为此,有必要设置适应系统的 Path 变量:转到控制面板 → 系统和安全 → 系统 → 高级系统设置 → 计算机名称、域和工作组设置 → 高级 → 环境变量在系统变量中找到路径变量,选择它并单击编辑.将 C:Program Filesgsgs9.23in(或安装 ghostscript 的目录)添加到 Path 变量中.在 Windows 10 中,您可以通过单击新建并输入路径来执行此操作.在其他 Windows 版本中,只需将路径附加到变量值,用分号分隔.重启 R对于 MacOS,请从 http://pages.uoregon.edu/koch/重启R
You need to tell R where to find ghostscript. For Windows, download ghostscript from http://ghostscript.com/download/gsdnld.html After installing ghostscript, we still need to tell R where to find ghostscript. To do so, it is necessary to set adapt your system’s Path variable: Go to Control Panel → System and Security → System → Advanced System Settings → computer name, domain and workgroup settings → Advanced → Environment Variables Find the Path variable within System Variables, select it and click on edit. Add C:Program Filesgsgs9.23in (or the directory where you installed ghostscript to) to the Path variable. In Windows 10, you can do this by clicking on New and entering the path. In other Windows versions, just append the path to the variable value, seperated by a semicolon. Restart R For MacOS, download and install the Ghostscript 9.23 package from http://pages.uoregon.edu/koch/ Restart R
我从这个网站找到了解决方案 https://rnbeads.org/data/installing_rnbeads.html一个>
I found the solution from this website https://rnbeads.org/data/installing_rnbeads.html
这篇关于对 RStudio 中的“工具未安装或不在 PATH:ghostcript"警告进行故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!