[R] Automatic adjustment of axis ranges

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Fri Jul 19 14:39:39 CEST 2002


On Fri, 19 Jul 2002, Jim Lemon wrote:

> I had a look at this, and worked out most of a function to do it. There
> are three things I haven't been able to figure out, however.
>
> 1) Getting the last N lines of the command history into a vector of
> strings. I thought something like:
>
> last.commands<-history(N)
>
> would work, but no go. There doesn't seem to be a file that I can tail,
> either.

What platform and GUI?  Read the code for history(): savehistory() will
usually (depending on platform/GUI/flags) save the history to a file.


> 2) Finding continuation lines by parenthesis matching. I thought this
> would be easy, but split() doesn't seem to do what the help file says, viz.
> "...in particular if split has length 0, x is split into single
> characters." Trying the following:

That's because you are reading the help page for strsplit ... so try using
                                                 ~~~~~~~~
strsplit("abc", "")!

> split("abc","")

[...]

> 3) Once I have the last plot command as a string, suitably modified,
> getting it to run.

eval(parse(text="newcommand"))

-- 
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

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list