- Ghostscript
When using the function
bitmap()
in Linux, the R system requires Ghostscript software to translate figure from ps file to other type image file, include jpeg, png and bmp etc. To download, install and get more information, see GNU Ghostscript or ESP Ghostscript.
- In Renviron file
Under
${R_HOME}/etc/Renviron
, add an R system environment variable for ghostscript. If the defaultgs
is at/usr/bin/gs
, that Renviron will beR_GSCMD=${R_GSCMD-'/usr/bin/gs'}
- In Script
If no permission to modify Renviron file, you can use the R command
Sys.putenv()
to setup the environment variable. If the defaultgs
is at/usr/bin/gs
, that environment variable can be setted bySys.putenv("R_GSCMD"="/usr/bin/gs")
See also
Sys.getenv()
.
- In MS-Windows
Use
gswin32c.exe
to instead ofgs
in Unix.