[R] Substituting a user-defined function for a standard function in graphics

David Winsemius dwinsemius at comcast.net
Wed Jul 15 23:04:28 CEST 2009


On Jul 15, 2009, at 4:25 PM, John Kolassa wrote:

> Dear R-help readers,
>     I'm trying to substitute my own version of plot.default, in  
> order to
> capture low-level graphics input for further manipulation.  I seem  
> to be
> having difficulties getting the versions of functions that I intend  
> to use
> called at the right places.
>     Specifically, I have an object produced by survfit from the  
> survival
> package, and I want to save the values that plot.survfit would  
> normally
> send to plot.default from the graphics package.

So wouldn't you instead create a modified plot.survfit? Looking at the  
plot.survfit code, it appears that the only time plot is called is to  
set up the axes  (i.e. with ,type="n", )and then other functions are  
used to draw the curves.

<snipped recounting of unsuccessful efforts>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list