[Rd] Odd behavior of plot function

Therneau, Terry M., Ph.D. therneau at mayo.edu
Thu Jun 11 18:52:02 CEST 2015


The following code snippet taken from plot.survfit now gives me a surprising result:

tempx <- c(0, 400, 0, 0)
ytemp <- c(.0657, .98, 1, 0)
plot(range(xtemp), range(ytemp), log='y', type='n')

In that the max value for the x axis is now 10.  The 0 on the end of ytemp was actually a 
mistake and shouldn't be there, if you remove it then the upper limit is sensible.

plot(range(xtemp), range(ytemp[1:3]), log='y', type='n')

I've now fixed this in the survival package.  I can't say when the odd behavior crept in, 
but am sure it was not always there.  I draw log scale plots only a few times a year.

Terry T.



More information about the R-devel mailing list