Skip to content
Prev 12587 / 398502 Next

plot() axis problem

On Fri, 27 Jul 2001, Petr Pikal wrote:

            
range() will enable you to simplify this considerably.  Using the space
bar might make it readable.  (The recommended assignment operator is <- :
if you must use _ at least have spaces around it.  See Writing R
Extensions chapter 3 for how to tidy up your R source code.)

replot <- function(x, y, type="l")
{
   body <- locator(2)
   plot(x, y, xlim=range(body$x), ylim=range(body$y), type=type)
}