[R] R performance, labeling questions, etc.

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed Feb 26 19:30:03 CET 2003


On Tue, 25 Feb 2003, Tony Vargas wrote:

> R helpers,
>
> I am trying to add labels to my graphs.  I have a Perl Program which
> generates thousands of R files like the one attached.
>
> My data files have 2 - 8 columns in them.  The first column of every data
> file is a header (Time) - which I want to have plotted against everything
> else.  My current formula just plots each column, which is fine, yet at
> the bottom for my labels I wind up with numbers.  What I would like to do
> is have R grab the Time label in increments of 144 data points and use
> that to label my X-axis instead of just plain numbers.  (Each data file
> has about 4400 columns).

Call plot() with xaxt="n", then call axis() to add the labels you want.
You can use plot.POSIXct as a model.

> I can kind of have R lable the bottom by chaning my plot to "plot(usr.cpu
> ~ Time), yet then the graphs take much, much longer to generate.

I presume that Time is a character variable, so a lot of conversion is goin
on: but we are short on details here.

> Worst case, I will use "plot(usr.cpu ~ Time)" - yet, anyone know why this
> would take a very, very long time?


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list