r - Windows R :grImport ghostscript error 'status 127'

标签 r ghostscript grimport

我已经在 R(Windows、Rstudio)中安装了 Ghostscript 和 grImport。我正在关注tutorial但我立即得到错误,

> library(grImport)
Loading required package: grid
Loading required package: XML
> PostScriptTrace("petal.ps")
Error in PostScriptTrace("petal.ps") : 
  status 127 in running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps'
In addition: Warning message:
running command 'gswin32c.exe -q -dBATCH -dNOPAUSE -sDEVICE=ps2write -sOutputFile=C:\Users\UsrNm\AppData\Local\Temp\RtmpsXXlWA\file1b5c623f48de -sstdout=petal.ps.xml capturepetal.ps' had status 127

如有任何帮助,我们将不胜感激。

最佳答案

我在Windows 10下遇到了同样的问题,我通过手动设置ghostscript的路径解决了这个问题:

Sys.setenv(R_GSCMD = normalizePath("C:/gs/gs9.20/bin/gswin32c.exe")) 

关于r - Windows R :grImport ghostscript error 'status 127' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35256501/

相关文章:

r - R中引号和表达式之间的区别

r - 在 ggplot2 的条形图中为分类变量添加阴影替代区域

pdf - 使用 Ghostscript 替换 PDF 中的颜色

syntax-highlighting - 将源代码转换为语法突出显示的图像

ghostscript - 如何使用 Ghostscript 和一系列页面特定裁剪框来裁剪多页 pdf

r - 在 grImport 的图片类中更改颜色

r - 在ggmap中使用图像作为点图标

R对行求和 - Data.frame

java - 保留:连接被拒绝:连接