[R] Three questions - loading(sourcing a file??), summaries to bitmaps, and error messages

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Feb 12 21:54:04 CET 2003

Tony Vargas <tvargas at cisco.com> writes:

> R helpers,
> I have three questions about R and was wondering if I could get some help.
> First, I am trying to send the output of a a summary command -
> summary("info") to a bitmap file instead of the default device.  Anybody
> know how to send a summary to a bitmap device?

Eh? Bitmap as in GIF/JPEG/... or what? Print to file is sink() if
that's what you mean. You can also sink() to a text connection and use
text() to put that on the graphics display (ruins tabular output, though).
> Second - this question is more difficult.  What I am trying to do is have
> Perl (because I already have the data structures loaded into
> hashes) generate a gigantic R file that I can then have R source, and then
> parse.  The output of the file(s) that I generate is below:

> my.badger.Sep.2002.cpu.utilization <-
> read.table(file="/auto/solperf/tgu/ActiveParsedFiles/badger/Sep.2002/cpu.utilization",
> sep="=", header=TRUE) names(my.badger.Sep.2002.cpu.utilization)
> attach(my.badger.Sep.2002.cpu.utilization) Tony Vargas Cisco Systems
> Engineering Computing Services (408) 525-4113 tvargas at cisco.com
> my.balvenie.Sep.2002.cpu.utilization <-
> read.table(file="/auto/solperf/tgu/ActiveParsedFiles/balvenie/Sep.2002/cpu.utilization",
> sep="=", header=TRUE) names(my.balvenie.Sep.2002.cpu.utilization)
> attach(my.balvenie.Sep.2002.cpu.utilization)

You seem to need semicolons or \n mefore names(...) I assume that your
address got in there with the aid of your emailer, not the Perl script?

> I tried having R do a "load" on my files, but I get the error messages
> below:
> > load("rgraphfileload")
> Error: bad restore file magic number (file may be corrupted)-- no data
> loaded
> Any idea why I would get the message above?  I am using R version 1.6.1 on
> a Solaris host.

load() is for binary files made by save() or save.image(). Were you
looking for source()?

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-help mailing list