Re: [R] viewing Postscript file

From: Marc Schwartz <>
Date: Fri 23 Jul 2004 - 09:44:02 EST

On Thu, 2004-07-22 at 16:50, Bickel, David wrote:
> Is there any R function that can display a Postscript file that is
> already in the working directory? For example, if '' is such a
> file, I'd like to type something like this:
> > plot.postscript.file(file = '')
> If no such function exists, I'd be interested in a way to use existing
> R functions to do this under UNIX or Windows, preferably without a
> system call to GhostView (gv).
> Thanks,
> David

I am not entirely sure what your expectations are here.

As you probably know, Postscript files (like PDF files) are text files that describe how to draw an image. It requires a Postscript interpreter (typically Ghostscript) to read the contents of the PS file and then something like GSview (or gv or ggv or ...) as a front end to render the image.

It is illusory, but you could create a R wrapper function and call it plot.postcript.file():

plot.postscript.file <- function(file = "") {
  # define viewer for UNIX/LINUX or Windows   viewer <- ifelse(.Platform$OS.type == "unix", "gv", "GSview")    

  system(paste(viewer, file, sep = " ")) }



HTH, Marc Schwartz mailing list PLEASE do read the posting guide! Received on Fri Jul 23 09:52:54 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:11 EST