如何解决“无法找到GhostScript可执行文件以对尺寸减小进行检查"在R中检查包裹时出错? [英] How to fix "Unable to find GhostScript executable to run checks on size reduction" error upon package check in R?

查看:147
本文介绍了如何解决“无法找到GhostScript可执行文件以对尺寸减小进行检查"在R中检查包裹时出错?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Revolution R Enterprise控制台中,

In Revolution R Enterprise console,

devtools::check("C:/Users/User/Documents/Revolution/mypackage")

产生

checking sizes of PDF files under 'inst/doc' ... NOTE
Unable to find GhostScript executable to run checks on size reduction

,无其他任何警告/错误/注释.因此,(尽管AFAIK对于最终检查而言,此注释并不重要),但我还是想摆脱此警告(因为我想将.PDF文件放入外部生成的 mypackage \ inst \ doc 文件夹中R).

with no any other warnings/errors/notes. So, (even though AFAIK this note is not that much important for eventual check), I wanted to get rid of this warning (since I wanna put .PDF files into mypackage\inst\doc folder produced outside of R).

我的笔记本中安装了Ghostscript.我通过以下方式得到了帮助:

I have Ghostscript installed in my notebook. I got helped via:

> help("R_GSCMD")
R_GSCMD: Optional. The path to Ghostscript, used by dev2bitmap, bitmap and embedFonts. 
Consulted when those functions are invoked. 
Since it will be treated as if passed to system, spaces and shell metacharacters should be escaped.


> Sys.getenv("R_GSCMD")
[1] ""

我所做的(又犯了错误)是:

What I did (and took error again) is:

> Sys.setenv("R_GSCMD") <- "C:\\Program Files (x86)\\gs\\gs9.19\\bin\\gswin32c.exe"
Error in Sys.setenv("R_GSCMD") <- "C:\\Program Files (x86)\\gs\\gs9.19\\bin\\gswin32c.exe" : 
  target of assignment expands to non-language object

加深后,我发现:[当错误尝试将值赋给不存在的变量或R不能视为名称时,就会发生这些错误.(名称是一个包含以下内容的变量类型:变量名.]

Upon deepening, I found: ["These errors occur when one tries to assign a value to a variable that doesn't exist, or that R can't treat as a name. (A name is a variable type that holds a variable name."]

我基本上想做的是将GS可执行文件(C:\ Program Files(x86)\ gs \ gs9.19 \ bin \ gswin32c.exe)设置为"R_GSCMD".任何帮助将不胜感激.

What I am basically trying to do is to set my GS executable (C:\Program Files (x86)\gs\gs9.19\bin\gswin32c.exe) to "R_GSCMD". Any help would be greatly appreciated.

推荐答案

在咨询?Sys.setenv 时,它确认了我的期望,该呼叫应改为:

On consulting ?Sys.setenv it confirms my expectation that the call should instead be:

Sys.setenv(R_GSCMD = "C:\\Program Files (x86)\\gs\\gs9.19\\bin\\gswin32c.exe")

这篇关于如何解决“无法找到GhostScript可执行文件以对尺寸减小进行检查"在R中检查包裹时出错?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆