2016-02-07 45 views
3

我已经在R(Windows,Rstudio)中安装了Ghostscript和grImport。我正在关注的tutorial但我立刻得到错误,Windows R:grImport ghostscript错误'状态127'

> 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 

任何帮助,将不胜感激。

+1

我不知道关于R任何东西,但你似乎是执行PostScriptTrace的说法“petal.ps”,但是,Ghostscript正在被调用并被要求处理一个名为'capturepetal.ps'的文件。所以也许它只是由文件不存在造成的。如果你可以在不使用-q的情况下运行Ghostscript,并捕获反向通道输出(标准输出似乎进入petal.ps.xml,所以你可以试着看)。 – KenS

+0

'capturepetal.ps'是我认为的输出文件。 –

回答

1

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

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