Hi everybody! Is there any way to read a postscrit file into R? All the best to you Ralf Finne SYH University of Applied Sciences Vasa Finland
On Tue, 20 Feb 2007, Ralf Finne wrote:> Hi everybody! > Is there any way to read a postscrit file into R?See http://www.r-project.org/useR-2006/Slides/Murrell.pdf page 4, the grImport package, now on CRAN, with further notes on Paul Murrell's home page: http://www.stat.auckland.ac.nz/~paul/> > All the best to you > Ralf Finne > SYH University of Applied Sciences > Vasa Finland > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
On 20-Feb-07 Ralf Finne wrote:> Hi everybody! > Is there any way to read a postscrit file into R? > > All the best to you > Ralf Finne > SYH University of Applied Sciences > Vasa FinlandWell, yes ... since a PostScript file is ASCII text you could use readline() ... but what you'd do with it after that I cannot imagine! [So I'm joking here] So, to come to the point: Why do you want to do that? If, for example, the PS file displays tabular data which you want to read into R as data, then perhaps one way would be to use suitable utility software to convert the PS file to a PDF file. Then you can display the PDF file using Acrobat Reader, and use the mouse to copy the data into a file which you can then edit up so that it can be read nicely into a dataframe in R. There are also utilities called ps2ascii (part of ghostscript; often fails to do a clean job) and pstotext which you can get from http://www.cs.wisc.edu/~ghost/doc/pstotext.htm (which claims to do a better job, though I've not tested it) which can convert a PS file into an ASCII text file which gives essentially the same text layout as seen when you display/print the PS file. You may then be able to edit this into a form which R can read as you want. But, for better targeted advice, it would be useful to know why you want to "read a PDF file into R"! Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 20-Feb-07 Time: 15:11:34 ------------------------------ XFMail ------------------------------